Skip to content

Commit 47a32e9

Browse files
committed
build: add debian based Dockerfile
1 parent 7301224 commit 47a32e9

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

Dockerfile.debian

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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"]

0 commit comments

Comments
 (0)