File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Build docker-gen from scratch
2
+ FROM golang:1.17.5 as go-builder
3
+
4
+ ARG VERSION=main
5
+
6
+ WORKDIR /build
7
+
8
+ # Install the dependencies
9
+ COPY . .
10
+ RUN go mod download
11
+
12
+ # Build the docker-gen executable
13
+ RUN GOOS=linux go build -ldflags "-X main.buildVersion=${VERSION}" -o docker-gen ./cmd/docker-gen
14
+
15
+ FROM debian:11-slim
16
+
17
+ LABEL maintainer="Jason Wilder <
[email protected] >"
18
+
19
+ ENV DOCKER_HOST unix:///tmp/docker.sock
20
+
21
+ # Install packages required by the image
22
+ RUN apt-get update \
23
+ && apt-get install -y -q --no-install-recommends openssl \
24
+ && apt-get clean \
25
+ && rm -r /var/lib/apt/lists/*
26
+
27
+ # Install docker-gen from build stage
28
+ COPY --from=go-builder /build/docker-gen /usr/local/bin/docker-gen
29
+
30
+ ENTRYPOINT ["/usr/local/bin/docker-gen"]
You can’t perform that action at this time.
0 commit comments