From 835a7e144a0068972c3bed41afba03896796e63b Mon Sep 17 00:00:00 2001 From: Bharat Kathi Date: Mon, 1 Jun 2026 20:27:48 -0700 Subject: [PATCH] fix(build): write the binary to /server instead of stomping on /app `go build -o /app` writes the output binary into the existing /app directory (WORKDIR), then `COPY /app /app` brings the directory across, so the final image's /app is a *directory*. ENTRYPOINT ["/app"] then fails at runtime with: unable to start container process: error during container init: exec: "/app": is a directory Build only succeeded in the first place because docker-compose ran the service via `air` (live reload) and never exercised the production image. Surfacing now because k8s runs the image as-is. Switch to /server: produce a single binary file, COPY it directly, ENTRYPOINT points at the file. Same fix in core, oauth, discord. --- core/Dockerfile | 8 +++----- discord/Dockerfile | 8 +++----- oauth/Dockerfile | 8 +++----- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/core/Dockerfile b/core/Dockerfile index 01107bc..79cf660 100644 --- a/core/Dockerfile +++ b/core/Dockerfile @@ -12,18 +12,16 @@ RUN go mod download COPY . ./ ARG TARGETOS ARG TARGETARCH -RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /app +RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /server ## ## Deploy ## FROM alpine:3.19 -WORKDIR / - -COPY --from=builder /app /app +COPY --from=builder /server /server COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo ENV TZ=America/Los_Angeles -ENTRYPOINT ["/app"] \ No newline at end of file +ENTRYPOINT ["/server"] \ No newline at end of file diff --git a/discord/Dockerfile b/discord/Dockerfile index 512b60e..435e6e9 100644 --- a/discord/Dockerfile +++ b/discord/Dockerfile @@ -12,18 +12,16 @@ RUN go mod download COPY . ./ ARG TARGETOS ARG TARGETARCH -RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /app +RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /server ## ## Deploy ## FROM alpine:3.19 -WORKDIR / - -COPY --from=builder /app /app +COPY --from=builder /server /server COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo ENV TZ=America/Los_Angeles -ENTRYPOINT ["/app"] +ENTRYPOINT ["/server"] diff --git a/oauth/Dockerfile b/oauth/Dockerfile index 512b60e..435e6e9 100644 --- a/oauth/Dockerfile +++ b/oauth/Dockerfile @@ -12,18 +12,16 @@ RUN go mod download COPY . ./ ARG TARGETOS ARG TARGETARCH -RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /app +RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /server ## ## Deploy ## FROM alpine:3.19 -WORKDIR / - -COPY --from=builder /app /app +COPY --from=builder /server /server COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo ENV TZ=America/Los_Angeles -ENTRYPOINT ["/app"] +ENTRYPOINT ["/server"]