Skip to content

Commit 3611303

Browse files
committed
chore: smaler docker image
1 parent 9306346 commit 3611303

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

Dockerfile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:bullseye AS build
1+
FROM golang:bullseye AS builder
22

33
COPY . .
44
COPY .docker/entrypoint.sh /entrypoint.sh
@@ -10,8 +10,17 @@ ENV VERSION=docker
1010
RUN make build
1111
RUN make build-plugins
1212

13-
RUN cp ./bin/druid* /usr/bin/
13+
# The binaries are in ./bin/ directory after build
1414

15+
# Second stage: minimal runtime image
16+
FROM debian:bullseye-slim
17+
18+
# Copy only the built binaries and entrypoint from builder
19+
COPY --from=builder /go/bin/druid* /usr/bin/
20+
COPY --from=builder /entrypoint.sh /entrypoint.sh
21+
RUN chmod +x /entrypoint.sh
22+
23+
# Set up user with the same UID/GID
1524
ARG UID=1000
1625
ARG GID=1000
1726
RUN groupadd -g $GID -o druid

0 commit comments

Comments
 (0)