Skip to content

Commit

Permalink
fix: Propagate CGO_ENABLED environment variable to docker build (#724)
Browse files Browse the repository at this point in the history
* fix: Add ability to statically compile binaries

* propagate env var from github action

* fix comment
  • Loading branch information
burdzwastaken authored Mar 27, 2024
1 parent 1b03d78 commit f3d6d9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f3d6d9d

Please sign in to comment.