Skip to content

Commit

Permalink
remove netgo
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Aug 9, 2024
1 parent f7efc88 commit 897d45b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
run: |
mkdir -p release
ZIP_OUTPUT=release/renterd_${GOOS}_${GOARCH}.zip
go build -tags="netgo" -trimpath -o bin/ -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/renterd
go build -trimpath -o bin/ -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/renterd
cp README.md LICENSE bin/
zip -qj $ZIP_OUTPUT bin/*
- uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
run: |
mkdir -p release
ZIP_OUTPUT=release/renterd${{ env.ZIP_OUTPUT_SUFFIX }}_${GOOS}_${GOARCH}.zip
go build -tags="netgo" -trimpath -o bin/ -a -ldflags '-s -w' ./cmd/renterd
go build -trimpath -o bin/ -a -ldflags '-s -w' ./cmd/renterd
cp README.md LICENSE bin/
/usr/bin/codesign --deep -f -v --timestamp -o runtime,library -s $APPLE_CERT_ID bin/renterd
ditto -ck bin $ZIP_OUTPUT
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
run: |
mkdir -p release
ZIP_OUTPUT=release/renterd${{ env.ZIP_OUTPUT_SUFFIX }}_${GOOS}_${GOARCH}.zip
go build -tags="netgo" -trimpath -o bin/ -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/renterd
go build -trimpath -o bin/ -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/renterd
azuresigntool sign -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvt "${{ secrets.AZURE_TENANT_ID }}" -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.digicert.com -v bin/renterd.exe
cp README.md LICENSE bin/
7z a $ZIP_OUTPUT bin/*
Expand Down
5 changes: 2 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
FROM golang:1.22 AS builder

# Define arguments for build tags and to skip running go generate.
ARG BUILD_TAGS='netgo' \
BUILD_RUN_GO_GENERATE='true'
ARG BUILD_RUN_GO_GENERATE='true'

# Set the working directory.
WORKDIR /renterd
Expand All @@ -23,7 +22,7 @@ RUN if [ "$BUILD_RUN_GO_GENERATE" = "true" ] ; then go generate ./... ; fi
# Build renterd.
RUN --mount=type=cache,target=/root/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=1 go build -ldflags='-s -w -linkmode external -extldflags "-static"' -tags="${BUILD_TAGS}" ./cmd/renterd
CGO_ENABLED=1 go build -ldflags='-s -w -linkmode external -extldflags "-static"' ./cmd/renterd

# Build image that will be used to run renterd.
FROM scratch
Expand Down

0 comments on commit 897d45b

Please sign in to comment.