Add a buildkit-cache workspace for preserving the buildkit cache between builds.
This commit is contained in:
parent
7ee31a1852
commit
ab59c05f09
@ -22,6 +22,10 @@ spec:
|
||||
description: Includes credentials for the docker image registry.
|
||||
optional: true
|
||||
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:
|
||||
- name: OUTPUT
|
||||
type: string
|
||||
@ -57,13 +61,23 @@ spec:
|
||||
description: Full URL to the docker image.
|
||||
type: array
|
||||
volumes:
|
||||
- name: buildkitd
|
||||
emptyDir: {}
|
||||
- name: buildkitd-toml
|
||||
emptyDir: {}
|
||||
- name: metadata-out
|
||||
emptyDir: {}
|
||||
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
|
||||
image: $(params.BUILDER_IMAGE)
|
||||
workingDir: "$(workspaces.source.path)"
|
||||
@ -87,8 +101,6 @@ spec:
|
||||
EOF
|
||||
chmod +x /home/user/.config/buildkit/entrypoint.sh
|
||||
volumeMounts:
|
||||
- name: buildkitd
|
||||
mountPath: /home/user/.local/share/buildkit
|
||||
- name: buildkitd-toml
|
||||
mountPath: /home/user/.config/buildkit
|
||||
securityContext:
|
||||
@ -112,8 +124,6 @@ spec:
|
||||
- /home/user/.metadata/build.json
|
||||
- $(params.EXTRA_ARGS)
|
||||
volumeMounts:
|
||||
- name: buildkitd
|
||||
mountPath: /home/user/.local/share/buildkit
|
||||
- name: buildkitd-toml
|
||||
mountPath: /home/user/.config/buildkit
|
||||
readOnly: true
|
||||
|
Loading…
x
Reference in New Issue
Block a user