Skip to content

Commit 208ab91

Browse files
EronWrightproject0
andauthored
Feat/optimize image size (#917)
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md) for Pulumi's contribution guidelines. Help us merge your changes more quickly by adding more details such as labels, milestones, and reviewers.--> ### Proposed changes <!--Give us a brief description of what you've done and what it solves. --> Based on: #852 apply common best practice for production builds to reduce weight of produced binaries. This decrease the size significantly from 171MB to 119MB ### Related issues (optional) <!--Refer to related PRs or issues: #1234, or 'Fixes #1234' or 'Closes #1234'. Or link to full URLs to issues or pull requests in other GitHub repositories. --> --------- Co-authored-by: Richard Hillmann <[email protected]>
1 parent f42d305 commit 208ab91

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55

66
- Fixed `rbac.extraRules` in Helm chart [#875](https://github.com/pulumi/pulumi-kubernetes-operator/pull/875)
77
- New example: pulumi-ts [#843](https://github.com/pulumi/pulumi-kubernetes-operator/pull/843)
8+
- Use optimized binaries in container images [#852](https://github.com/pulumi/pulumi-kubernetes-operator/pull/852)
89

910
## 2.0.0 (2025-02-18)
1011

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN --mount=type=cache,target=${GOCACHE} \
2525
--mount=type=bind,source=/agent,target=./agent \
2626
--mount=type=bind,source=/operator,target=./operator \
2727
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} \
28-
go build -a -o /manager -ldflags="-X github.com/pulumi/pulumi-kubernetes-operator/v2/operator/version.Version=${VERSION}" ./operator/cmd/main.go
28+
go build -a -o /manager -ldflags="-w -X github.com/pulumi/pulumi-kubernetes-operator/v2/operator/version.Version=${VERSION}" ./operator/cmd/main.go
2929

3030
# Build the agent.
3131
FROM --platform=${BUILDPLATFORM} base AS agent-builder
@@ -37,7 +37,7 @@ RUN --mount=type=cache,target=${GOCACHE} \
3737
--mount=type=cache,target=${GOMODCACHE} \
3838
--mount=type=bind,source=/agent,target=./agent \
3939
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} \
40-
go build -a -o /agent -ldflags "-X github.com/pulumi/pulumi-kubernetes-operator/v2/agent/version.Version=${VERSION}" ./agent/main.go
40+
go build -a -o /agent -ldflags "-w -X github.com/pulumi/pulumi-kubernetes-operator/v2/agent/version.Version=${VERSION}" ./agent/main.go
4141

4242
# Use distroless as minimal base image to package the manager binary
4343
# Refer to https://github.com/GoogleContainerTools/distroless for more details

0 commit comments

Comments
 (0)