Skip to content

Commit f76ccc1

Browse files
chore: update Dockerfile for improved build process and functionality
- Add bash to the builder stage for enhanced scripting capabilities. - Change the base image for the runner stage to gcr.io/distroless/static-debian12 for better compatibility. - Ensure CGO is disabled during the build for a more efficient binary.
1 parent 0e4ab43 commit f76ccc1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

server/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ FROM golang:1.24.0-alpine AS builder
22

33
WORKDIR /app
44

5+
RUN apk add --no-cache bash
6+
57
COPY . .
68

7-
RUN go build -ldflags="-s -w" -o rabbit.go main.go
9+
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o rabbit.go main.go
810

9-
FROM debian:12 AS runner
11+
FROM gcr.io/distroless/static-debian12 AS runner
1012

1113
COPY --from=builder /app/rabbit.go /usr/local/bin/rabbit.go
1214
COPY --from=builder /app/internal/database/migrations.sql /usr/local/bin/internal/database/migrations.sql
13-
RUN apk add --no-cache net-tools
15+
COPY --from=builder /bin/bash /bin/bash
1416

1517
# 9999 is the tunnel server port
1618
# 3422 is the API port (never expose this port to the internet)

0 commit comments

Comments
 (0)