build: clean ./bin/ for Docker build

Running `make all` before `docker build` would result in unwanted binaries being copied from `./bin/` into the Docker image (via `COPY . .`).

This change updates the Docker build to run `make clean build`, which removes the bin directory then builds a fresh binary.

This approach was chosen over including a `.dockerignore` file or using `COPY --exclude ...` (currently listed as unstable).
This commit is contained in:
Ryan Smith
2025-05-22 10:57:23 -07:00
parent 0def1728ee
commit c0d8651c7f

View File

@@ -3,7 +3,7 @@ FROM golang:latest AS build-stage
WORKDIR /build
COPY . .
RUN git update-index -q --refresh
RUN make
RUN make clean build
FROM alpine:latest
RUN apk add --no-cache tzdata