File tree Expand file tree Collapse file tree 6 files changed +57
-12
lines changed
Expand file tree Collapse file tree 6 files changed +57
-12
lines changed Original file line number Diff line number Diff line change 1- # More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2- # Ignore build and test binaries.
1+ # Version control
2+ .git
3+ .gitignore
4+
5+ # Documentation
6+ * .md
7+ docs /
8+
9+ # Tests
10+ * _test.go
11+ internal /testhelpers
12+ internal /tests
13+
14+ # Development
15+ .env
16+ .env. *
17+ * .log
18+ skaffold.yaml
19+ skaffold.example.env
20+
21+ # Build artifacts
322bin /
423helm /
524internal /demo
25+
26+ # IDE
27+ .vscode
28+ .idea
29+ * .swp
30+
31+ # CI/CD
32+ .github
33+ .goreleaser.yml
34+ .goreleaser.main.yml
35+
36+ # Go
37+ go.work
38+ go.work.sum
Original file line number Diff line number Diff line change 3535 check-latest : true
3636
3737 - name : Set up Docker Buildx
38- uses : docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
38+ uses : docker/setup-buildx-action@v3
3939
4040 - name : Login to Docker Hub
4141 uses : docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
5151 args : release
5252 env :
5353 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
54+ BUILDKIT_INLINE_CACHE : 1
5455
5556 helm :
5657 needs : release
Original file line number Diff line number Diff line change @@ -34,16 +34,25 @@ jobs:
3434 - name : Build worker-controller image
3535 run : |
3636 skaffold build --profile worker-controller --push=false
37+ env :
38+ DOCKER_BUILDKIT : 1
39+ BUILDKIT_PROGRESS : plain
3740
3841 - name : Build helloworld worker image
3942 run : |
4043 skaffold build --profile helloworld-worker --push=false
44+ env :
45+ DOCKER_BUILDKIT : 1
46+ BUILDKIT_PROGRESS : plain
4147
4248 # Verify that the demo worker patch applies successfully and builds.
4349 - name : Build helloworld worker image patch
4450 run : |
4551 git apply internal/demo/helloworld/changes/no-version-gate.patch
4652 skaffold build --profile helloworld-worker --push=false
53+ env :
54+ DOCKER_BUILDKIT : 1
55+ BUILDKIT_PROGRESS : plain
4756
4857 test-integration :
4958 name : Run Integration Tests
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ dockers:
4242 use : buildx
4343 build_flag_templates :
4444 - --platform=linux/amd64
45+ - --cache-from=type=gha,scope=amd64
46+ - --cache-to=type=gha,mode=max,scope=amd64
4547 - --label=org.opencontainers.image.title={{ .ProjectName }}
4648 - --label=org.opencontainers.image.description=Temporal Worker Controller for Kubernetes
4749 - --label=org.opencontainers.image.url=https://github.com/temporalio/temporal-worker-controller
@@ -63,6 +65,8 @@ dockers:
6365 use : buildx
6466 build_flag_templates :
6567 - --platform=linux/arm64
68+ - --cache-from=type=gha,scope=arm64
69+ - --cache-to=type=gha,mode=max,scope=arm64
6670 - --label=org.opencontainers.image.title={{ .ProjectName }}
6771 - --label=org.opencontainers.image.description=Temporal Worker Controller for Kubernetes
6872 - --label=org.opencontainers.image.url=https://github.com/temporalio/temporal-worker-controller
Original file line number Diff line number Diff line change 1- # Build the manager binary
21FROM golang:1.25 AS builder
32ARG TARGETOS
43ARG TARGETARCH
54
65WORKDIR /workspace
7- # Copy the Go Modules manifests
8- COPY go.mod go.mod
9- COPY go.sum go.sum
10- # cache deps before building and copying source so that we don't need to re-download as much
11- # and so that source changes don't invalidate our downloaded layer
6+
7+ COPY go.mod go.sum ./
128RUN go mod download
139
14- # Copy the go source
1510COPY cmd/main.go cmd/main.go
1611COPY api/ api/
1712COPY internal/k8s internal/k8s
@@ -20,7 +15,6 @@ COPY internal/controller internal/controller
2015COPY internal/planner internal/planner
2116COPY internal/defaults internal/defaults
2217
23- # Build
2418# the GOARCH has not a default value to allow the binary be built according to the host where the command
2519# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
2620# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
Original file line number Diff line number Diff line change 11FROM gcr.io/distroless/static-debian12:nonroot
22
3- COPY temporal-worker-controller /usr/local/bin/temporal-worker-controller
3+ WORKDIR /app
4+
5+ COPY --chown=nonroot:nonroot temporal-worker-controller /usr/local/bin/temporal-worker-controller
6+
7+ USER nonroot
48
59ENTRYPOINT ["temporal-worker-controller"]
You can’t perform that action at this time.
0 commit comments