Skip to content

Commit 617a595

Browse files
committed
chore: set CGO_ENABLED=0 for the bin and image release
Signed-off-by: peefy <[email protected]>
1 parent 09d9cf7 commit 617a595

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

.goreleaser.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ before:
99
# .goreleaser.yml
1010
builds:
1111
- id: default
12+
env:
13+
- CGO_ENABLED=0
1214
main: ./cmd/kcl/main.go
1315
binary: kcl
1416
goos:
@@ -18,8 +20,6 @@ builds:
1820
goarch:
1921
- amd64
2022
- arm64
21-
flags:
22-
- -tags=rpc
2323
ldflags:
2424
- "-X kcl-lang.io/cli/pkg/version.version={{.Version}}"
2525

Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ WORKDIR /src
99
ARG TARGETOS
1010
ARG TARGETARCH
1111

12+
ENV CGO_ENABLED=0
13+
1214
RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build
1315

1416
FROM --platform=${BUILDPLATFORM} ubuntu:22.04 AS base
@@ -20,16 +22,11 @@ ARG TARGETARCH
2022

2123
COPY --from=build /src/bin/kcl /usr/local/bin/kcl
2224
RUN /usr/local/bin/kcl
23-
RUN cp -r /root/go/bin/* /usr/local/bin/
2425
RUN apt-get update && apt-get install make gcc git -y && rm -rf /var/lib/apt/lists/*
2526
# The reason for doing this below is to prevent the
2627
# container from not having write permissions.
2728
ENV KCL_PKG_PATH=/tmp
2829
ENV KCL_CACHE_PATH=/tmp
29-
# In the image, we can generate a runtime in advance to
30-
# avoid writing files in the image
31-
ENV KCL_GO_DISABLE_INSTALL_ARTIFACT=true
32-
ENV KCL_GO_DISABLE_ARTIFACT_IN_PATH=false
3330
# Install the tini
3431
ENV TINI_VERSION v0.19.0
3532
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini

0 commit comments

Comments
 (0)