Skip to content

Commit d801cc0

Browse files
authored
Merge pull request #6 from kn100/minimize-image
minimise by moving to 'distroless' and using upx
2 parents 93fdf50 + 95ab0be commit d801cc0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Dockerfile

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
FROM golang AS build
1+
FROM golang:bullseye AS build
22
WORKDIR /app
3+
RUN apt-get update && apt-get install upx -y
34
COPY go.* /app/
45
RUN go mod download
56
COPY . .
6-
RUN go build -ldflags="-s -w" -o telescan
7+
ENV CGO_ENABLED=0
8+
RUN go build -o telescan
9+
RUN upx telescan
710

8-
FROM debian:bookworm-slim AS run
9-
RUN apt-get update && apt-get install -y ca-certificates
10-
RUN rm -rf /var/lib/apt/lists/*
11+
FROM gcr.io/distroless/static-debian11
1112
COPY --from=build /app/telescan /telescan
1213
ENTRYPOINT ["/telescan"]

0 commit comments

Comments
 (0)