File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change
1
+ # Build docker-gen from scratch
2
+ FROM golang:1.14-alpine as dockergen
3
+ RUN apk add --no-cache git
4
+
5
+ # Download the sources for the given version
6
+ ENV VERSION 0.7.4
7
+ ADD https://github.com/jwilder/docker-gen/archive/${VERSION}.tar.gz sources.tar.gz
8
+
9
+ # Move the sources into the right directory
10
+ RUN tar -xzf sources.tar.gz && \
11
+ mkdir -p /go/src/github.com/jwilder/ && \
12
+ mv docker-gen-* /go/src/github.com/jwilder/docker-gen
13
+
14
+ # Install the dependencies and make the docker-gen executable
15
+ WORKDIR /go/src/github.com/jwilder/docker-gen
16
+ RUN go get -v ./... && \
17
+ CGO_ENABLED=0 GOOS=linux go build -ldflags "-X main.buildVersion=${VERSION}" ./cmd/docker-gen
18
+
1
19
FROM alpine:latest
2
20
LABEL maintainer=
"Jason Wilder <[email protected] >"
3
21
4
22
RUN apk -U add openssl
5
23
6
- ENV VERSION 0.7.3
7
- ENV DOWNLOAD_URL https:// github.com/jwilder/docker-gen/releases/download/$VERSION/ docker-gen-alpine-linux-amd64-$VERSION.tar.gz
24
+ ENV VERSION 0.7.4
25
+ COPY --from=dockergen /go/src/ github.com/jwilder/docker-gen/docker-gen /usr/local/bin/ docker-gen
8
26
ENV DOCKER_HOST unix:///tmp/docker.sock
9
27
10
- RUN wget -qO- $DOWNLOAD_URL | tar xvz -C /usr/local/bin
11
28
12
29
ENTRYPOINT ["/usr/local/bin/docker-gen" ]
You can’t perform that action at this time.
0 commit comments