Skip to content

Commit

Permalink
kas-container: forward REGISTRY_AUTH_FILE to the container
Browse files Browse the repository at this point in the history
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

Signed-off-by: Benedikt Niedermayr <[email protected]>
  • Loading branch information
bniedermayr committed Jul 15, 2024
1 parent 4c33eda commit 228893e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kas-container
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 228893e

Please sign in to comment.