fix: Propagate CGO_ENABLED environment variable to docker build (#724)

* fix: Add ability to statically compile binaries

* propagate env var from github action

* fix comment
This commit is contained in:
Matt Burdan 2024-03-27 13:44:58 +08:00 committed by GitHub
parent 1b03d78800
commit f3d6d9d73e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -33,3 +33,5 @@ jobs:
push: false
tags: pgweb:latest
platforms: linux/amd64,linux/arm64,linux/arm/v7
build-args: |
"CGO_ENABLED=${{ env.CGO_ENABLED }}"

View File

@ -3,6 +3,10 @@
# ------------------------------------------------------------------------------
FROM golang:1.22-bullseye AS build
# Set default build argument for CGO_ENABLED
ARG CGO_ENABLED=0
ENV CGO_ENABLED ${CGO_ENABLED}
WORKDIR /build
RUN git config --global --add safe.directory /build