forked from nginx-proxy/docker-gen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (17 loc) · 660 Bytes
/
Dockerfile
File metadata and controls
27 lines (17 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Build docker-gen from scratch
FROM golang:1.16-alpine as go-builder
ARG VERSION=master
WORKDIR /build
# Install the dependencies
COPY . .
RUN go mod download -json
# Build the docker-gen executable
RUN CGO_ENABLED=0 go build -ldflags "-X main.buildVersion=${VERSION}" -o docker-gen ./cmd/docker-gen
FROM alpine:3.13
LABEL maintainer="Jason Wilder <mail@jasonwilder.com>"
ENV DOCKER_HOST unix:///tmp/docker.sock
# Install packages required by the image
RUN apk add --no-cache --virtual .bin-deps openssl
# Install docker-gen from build stage
COPY --from=go-builder /build/docker-gen /usr/local/bin/docker-gen
ENTRYPOINT ["/usr/local/bin/docker-gen"]