Compare commits

..

1 Commits

Author SHA1 Message Date
Tom Alexander
ab59c05f09
Add a buildkit-cache workspace for preserving the buildkit cache between builds. 2025-02-22 12:08:16 -05:00

View File

@ -22,6 +22,10 @@ spec:
description: Includes credentials for the docker image registry. description: Includes credentials for the docker image registry.
optional: true optional: true
mountPath: /home/user/.docker mountPath: /home/user/.docker
- name: buildkit-cache
description: For preserving buildkit type=cache mounts between builds.
optional: true
mountPath: /home/user/.local/share/buildkit
params: params:
- name: OUTPUT - name: OUTPUT
type: string type: string
@ -57,13 +61,23 @@ spec:
description: Full URL to the docker image. description: Full URL to the docker image.
type: array type: array
volumes: volumes:
- name: buildkitd
emptyDir: {}
- name: buildkitd-toml - name: buildkitd-toml
emptyDir: {} emptyDir: {}
- name: metadata-out - name: metadata-out
emptyDir: {} emptyDir: {}
steps: steps:
- name: setup-cache-ownership
image: $(params.BUILDER_IMAGE)
workingDir: "$(workspaces.source.path)"
script: |
#!/usr/bin/env sh
set -euo pipefail
chown 1000:1000 /home/user/.local/share/buildkit
chmod 0777 /home/user/.local/share/buildkit
securityContext:
runAsNonRoot: false
runAsUser: 0
runAsGroup: 0
- name: write-config - name: write-config
image: $(params.BUILDER_IMAGE) image: $(params.BUILDER_IMAGE)
workingDir: "$(workspaces.source.path)" workingDir: "$(workspaces.source.path)"
@ -87,8 +101,6 @@ spec:
EOF EOF
chmod +x /home/user/.config/buildkit/entrypoint.sh chmod +x /home/user/.config/buildkit/entrypoint.sh
volumeMounts: volumeMounts:
- name: buildkitd
mountPath: /home/user/.local/share/buildkit
- name: buildkitd-toml - name: buildkitd-toml
mountPath: /home/user/.config/buildkit mountPath: /home/user/.config/buildkit
securityContext: securityContext:
@ -112,8 +124,6 @@ spec:
- /home/user/.metadata/build.json - /home/user/.metadata/build.json
- $(params.EXTRA_ARGS) - $(params.EXTRA_ARGS)
volumeMounts: volumeMounts:
- name: buildkitd
mountPath: /home/user/.local/share/buildkit
- name: buildkitd-toml - name: buildkitd-toml
mountPath: /home/user/.config/buildkit mountPath: /home/user/.config/buildkit
readOnly: true readOnly: true