We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd617f9 commit 515e394Copy full SHA for 515e394
1 file changed
ansible/roles/run-test-target/tasks/test-docker.yml
@@ -54,10 +54,16 @@
54
become: "{{ runtime_as_root }}"
55
shell:
56
cmd: |
57
- if [[ -f "/run/containers/0/auth.json" ]]; then
58
mkdir -p ~/.docker/
59
- cp "/run/containers/0/auth.json" ~/.docker/config.json
60
- fi
+ if [[ -f "${XDG_RUNTIME_DIR:-}/containers/auth.json" ]]; then
+ AUTH_FILE="${XDG_RUNTIME_DIR:-}/containers/auth.json"
+ elif [[ -f "/run/containers/0/auth.json" ]]; then
61
+ AUTH_FILE="/run/containers/0/auth.json"
62
+ else
63
+ echo >&2 "No valid auth.json file found"
64
+ exit 1
65
+ fi
66
+ cp "${AUTH_FILE}" ~/.docker/config.json
67
creates: ~/.docker/config.json
68
when: runtime_command == "podman"
69
0 commit comments