Skip to content

Commit fb59485

Browse files
authored
Merge pull request #1 from seatgeek/kiril/dockerfile
Some small improvements to the Dockerfile
2 parents 678cc2b + a1726fd commit fb59485

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Stage for building the manage binary within Docker
2-
FROM docker.io/golang:1.24 AS builder
2+
FROM docker.io/library/golang:1.24 AS builder
33
ARG TARGETOS
44
ARG TARGETARCH
55

@@ -17,7 +17,7 @@ COPY api/ api/
1717
COPY internal/ internal/
1818

1919
# Build
20-
# the GOARCH has not a default value to allow the binary be built according to the host where the command
20+
# the GOARCH has no default value to allow the binary be built according to the host where the command
2121
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
2222
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
2323
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
@@ -26,7 +26,7 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o ma
2626
# Default final stage - builds from scratch
2727
# Use distroless as minimal base image to package the manager binary
2828
# Refer to https://github.com/GoogleContainerTools/distroless for more details
29-
FROM gcr.io/distroless/static:nonroot as final
29+
FROM gcr.io/distroless/static:nonroot AS final
3030
WORKDIR /
3131
COPY --from=builder /workspace/manager .
3232
USER 65532:65532
@@ -36,7 +36,7 @@ ENTRYPOINT ["/manager"]
3636
FROM gcr.io/distroless/static:nonroot AS final_prebuilt
3737
ARG TARGETARCH
3838
WORKDIR /
39-
COPY manager-${TARGETARCH} manager
39+
COPY --chmod=0755 manager-${TARGETARCH} manager
4040
USER 65532:65532
4141
ENTRYPOINT ["/manager"]
4242

0 commit comments

Comments
 (0)