[PATCH 2/3] kas-container: forward REGISTRY_AUTH_FILE to the container

1 view
Skip to first unread message

B. Niedermayr

unread,
Jul 12, 2024, 4:17:42 AM (5 days ago) Jul 12
to kas-...@googlegroups.com
From: Benedikt Niedermayr <benedikt....@siemens.com>

Mount the REGISTRY_AUTH_FILE into the container, so kas can use
it. The REGISTRY_AUTH_FILE specifies a file that is used by docker,
podman and skopeo for container registry login.

Signed-off-by: Benedikt Niedermayr <benedikt....@siemens.com>
---
kas-container | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/kas-container b/kas-container
index 169ea1bc4555..51c31e3cd710 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
--
2.34.1

B. Niedermayr

unread,
Jul 12, 2024, 10:39:39 AM (5 days ago) Jul 12
to kas-...@googlegroups.com
From: Benedikt Niedermayr <benedikt....@siemens.com>

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 specified here [1].

[1] https://github.com/containers/image/blob/main/docs/containers-auth.json.5.md

B. Niedermayr

unread,
Jul 12, 2024, 2:24:20 PM (5 days ago) Jul 12
to kas-...@googlegroups.com

Benedikt Niedermayr

unread,
Jul 15, 2024, 7:44:08 AM (2 days ago) Jul 15
to kas-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages