mirror of
https://github.com/r-smith/deceptifeed.git
synced 2025-10-23 00:12:22 +00:00
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).
12 lines
270 B
Docker
12 lines
270 B
Docker
# syntax=docker/dockerfile:1
|
|
FROM golang:latest AS build-stage
|
|
WORKDIR /build
|
|
COPY . .
|
|
RUN git update-index -q --refresh
|
|
RUN make clean build
|
|
|
|
FROM alpine:latest
|
|
RUN apk add --no-cache tzdata
|
|
WORKDIR /data
|
|
COPY --from=build-stage /build/bin /
|
|
ENTRYPOINT ["/deceptifeed"] |