mirror of
https://github.com/renorris/openfsd
synced 2026-04-20 18:07:11 +08:00
fix dockerfile
This commit is contained in:
@@ -16,6 +16,9 @@ WORKDIR /go/src/openfsd
|
|||||||
# Add the sources
|
# Add the sources
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Download modules
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
# Compile
|
# Compile
|
||||||
RUN mkdir -p build && CGO_ENABLED=0 GOOS=linux go build -v -o build/openfsd -ldflags "-s -w" main.go
|
RUN mkdir -p build && CGO_ENABLED=0 GOOS=linux go build -v -o build/openfsd -ldflags "-s -w" main.go
|
||||||
|
|
||||||
@@ -23,7 +26,7 @@ RUN mkdir -p build && CGO_ENABLED=0 GOOS=linux go build -v -o build/openfsd -ldf
|
|||||||
COPY --from=upx /bin/upx /bin/upx
|
COPY --from=upx /bin/upx /bin/upx
|
||||||
|
|
||||||
# Compress with upx
|
# Compress with upx
|
||||||
RUN /bin/upx -v -9 openfsd
|
RUN upx -v -9 build/openfsd
|
||||||
|
|
||||||
# Final distroless image
|
# Final distroless image
|
||||||
FROM gcr.io/distroless/static-debian12
|
FROM gcr.io/distroless/static-debian12
|
||||||
|
|||||||
Reference in New Issue
Block a user