From c0d8651c7fac7eff1f0cbe561ff963efd7fb94fb Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Thu, 22 May 2025 10:57:23 -0700 Subject: [PATCH] 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). --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 15fb2e7..33502a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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