From 43b0af2190b20fba2637b29762f7c69c6e4aa865 Mon Sep 17 00:00:00 2001 From: Benedikt Niedermayr Date: Tue, 16 Jul 2024 13:12:09 +0200 Subject: [PATCH] kas-container: forward REGISTRY_AUTH_FILE to the container Mount the REGISTRY_AUTH_FILE into the container, so kas can use it. The REGISTRY_AUTH_FILE specifies a a container registry authentication file that is used by docker, podman and skopeo for container registry login. The file syntax is described here [1]. [1] https://github.com/containers/image/blob/main/docs/containers-auth.json.5.md Signed-off-by: Benedikt Niedermayr Signed-off-by: Jan Kiszka --- kas-container | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kas-container b/kas-container index 169ea1bc..51c31e3c 100755 --- a/kas-container +++ b/kas-container @@ -512,6 +512,11 @@ if [ -f "${GITCONFIG_FILE}" ]; then -e GITCONFIG_FILE="/var/kas/userdata/.gitconfig" fi +if [ -f "${REGISTRY_AUTH_FILE}" ]; then + set -- "$@" -v "$(readlink -fv "${REGISTRY_AUTH_FILE}")":/var/kas/userdata/.docker/config.json:ro \ + -e REGISTRY_AUTH_FILE="/var/kas/userdata/.docker/config.json" +fi + if [ -t 1 ]; then set -- "$@" -t -i fi