File tree Expand file tree Collapse file tree 2 files changed +23
-9
lines changed
functions/examples/template-heredoc-cockroachdb Expand file tree Collapse file tree 2 files changed +23
-9
lines changed Original file line number Diff line number Diff line change 1
1
# Copyright 2019 The Kubernetes Authors.
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
- .PHONY : image
4
+ # This example uses a pinned version of the kustomize image, as an example of
5
+ # what users should do downstream, to ensure supply chain security.
6
+ #
7
+ # Whenever KUSTOMIZE_IMAGE_TAG & KUSTOMIZE_IMAGE_SHA are updated,
8
+ # EXAMPLE_IMAGE_TAG should also be updated to a new patch version.
9
+ # For reference, see
10
+ # https://github.com/kubernetes/k8s.io/blob/main/registry.k8s.io/images/k8s-staging-kustomize/images.yaml
11
+ EXAMPLE_IMAGE_TAG =v0.1.1
12
+ KUSTOMIZE_IMAGE_TAG =v5.4.1
13
+ KUSTOMIZE_IMAGE_SHA =sha256:7492c35d6fbe64e05100009915167a37b285ca7391067fa0c7bec9a7d1856882
5
14
6
15
all :
7
16
true
8
17
9
- image :
10
- docker build image -t gcr.io/kustomize-functions/example-cockroachdb:v0.1.0
11
- docker push gcr.io/kustomize-functions/example-cockroachdb:v0.1.0
18
+ .PHONY : image-build
19
+ image-build :
20
+ docker build image \
21
+ --build-arg " KUSTOMIZE_IMAGE_TAG=$( KUSTOMIZE_IMAGE_TAG) " \
22
+ --build-arg " KUSTOMIZE_IMAGE_SHA=$( KUSTOMIZE_IMAGE_SHA) " \
23
+ -t gcr.io/kustomize-functions/example-cockroachdb:$(EXAMPLE_IMAGE_TAG )
24
+
25
+ .PHONY : image
26
+ image : image-build
27
+ docker push gcr.io/kustomize-functions/example-cockroachdb:$(EXAMPLE_IMAGE_TAG )
Original file line number Diff line number Diff line change 1
1
# Copyright 2019 The Kubernetes Authors.
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
- FROM golang:1.21-bullseye
5
- ENV CGO_ENABLED=0
6
- RUN go get -v sigs.k8s.io/kustomize/kustomize
4
+ ARG KUSTOMIZE_IMAGE_TAG
5
+ ARG KUSTOMIZE_IMAGE_SHA
7
6
8
- FROM alpine:latest
7
+ FROM registry.k8s.io/kustomize/kustomize:${KUSTOMIZE_IMAGE_TAG}@${KUSTOMIZE_IMAGE_SHA}
9
8
RUN apk add --no-cache bash
10
- COPY --from=0 /go/bin/kustomize /usr/local/bin
11
9
COPY cockroachdb-template.sh /usr/local/bin/config-function
12
10
CMD ["config-function" ]
You can’t perform that action at this time.
0 commit comments