Start ssh agent.

This commit is contained in:
Tom Alexander 2024-10-20 17:40:04 -04:00
parent 8e4e323389
commit 3411d0cd39
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -73,6 +73,15 @@ spec:
tee /home/user/.config/buildkit/buildkitd.toml <<EOF
$(params.BUILDKITD_TOML)
EOF
cat > /home/user/.config/buildkit/entrypoint.sh <<EOF
#!/usr/bin/env sh
#
set -euo pipefail
eval \$(ssh-agent)
ssh-add /tekton/creds/.ssh/id_*
exec buildctl-daemonless.sh build --ssh default=\$SSH_AUTH_SOCK "\${@}"
EOF
chmod +x /home/user/.config/buildkit/entrypoint.sh
volumeMounts:
- name: buildkitd
mountPath: /home/user/.local/share/buildkit
@ -85,9 +94,8 @@ spec:
- name: build-and-push
image: $(params.BUILDER_IMAGE)
workingDir: "$(workspaces.source.path)"
command: ["buildctl-daemonless.sh"]
command: ["/home/user/.config/buildkit/entrypoint.sh"]
args:
- build
- --frontend
- dockerfile.v0
- --local