Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
# Build docker-gen from scratch
FROM golang:1.14-alpine as dockergen
RUN apk add --no-cache git

# Download the sources for the given version
ENV VERSION 0.7.4
ADD https://github.com/jwilder/docker-gen/archive/${VERSION}.tar.gz sources.tar.gz

# Move the sources into the right directory
RUN tar -xzf sources.tar.gz && \
mkdir -p /go/src/github.com/jwilder/ && \
mv docker-gen-* /go/src/github.com/jwilder/docker-gen

# Install the dependencies and make the docker-gen executable
WORKDIR /go/src/github.com/jwilder/docker-gen
RUN go get -v ./... && \
CGO_ENABLED=0 GOOS=linux go build -ldflags "-X main.buildVersion=${VERSION}" ./cmd/docker-gen

FROM alpine:latest
LABEL maintainer="Jason Wilder <[email protected]>"

RUN apk -U add openssl

ENV VERSION 0.7.3
ENV DOWNLOAD_URL https://github.com/jwilder/docker-gen/releases/download/$VERSION/docker-gen-alpine-linux-amd64-$VERSION.tar.gz
ENV VERSION 0.7.4
COPY --from=dockergen /go/src/github.com/jwilder/docker-gen/docker-gen /usr/local/bin/docker-gen
ENV DOCKER_HOST unix:///tmp/docker.sock

RUN wget -qO- $DOWNLOAD_URL | tar xvz -C /usr/local/bin

ENTRYPOINT ["/usr/local/bin/docker-gen"]