fix dockerfile

This commit is contained in:
Zoe
2024-12-14 03:13:16 -06:00
parent de22bd20c9
commit 2bd953dcb6
3 changed files with 19 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
FROM golang:1.23-bookworm as builder
FROM golang:1.23-bookworm AS builder
WORKDIR /app
@@ -8,13 +8,18 @@ RUN go mod download
COPY . .
RUN GOOS=linux go build -o fluxd cmd/fluxd/main.go
RUN CGO_ENABLED=1 GOOS=linux go build -o fluxd ./cmd/fluxd/main.go
FROM golang:1.23-bookworm
RUN (curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.36.0/pack-v0.36.0-linux.tgz" | tar -C /usr/local/bin/ --no-same-owner -xzv pack)
RUN apt-get install -y ca-certificates
COPY --from=builder /app/fluxd /usr/local/bin/fluxd
ENV PATH="/usr/local/bin:${PATH}"
VOLUME ["/var/run/docker.sock"]
EXPOSE 5647 7465
VOLUME [ "/var/run/docker.sock" ]
CMD ["/app/fluxd"]
ENTRYPOINT ["fluxd"]