diff --git a/.github/actions/gcp-docker-login/action.yml b/.github/actions/gcp-docker-login/action.yml index 51ac32fe9..85a3370cd 100644 --- a/.github/actions/gcp-docker-login/action.yml +++ b/.github/actions/gcp-docker-login/action.yml @@ -34,8 +34,14 @@ runs: - name: Setup registry mirror shell: bash run: | + # Create daemon.json if it doesn't exist + if [ ! -f /etc/docker/daemon.json ]; then + echo '{}' | sudo tee /etc/docker/daemon.json > /dev/null + fi + + # Add or update registry-mirrors configuration echo "$(jq '. += { "registry-mirrors": ["https://mirror.gcr.io"] }' /etc/docker/daemon.json)" > new_daemon.json - sudo mv -f new_daemon.json /etc/docker/daemon.json + sudo mv new_daemon.json /etc/docker/daemon.json sudo service docker restart - name: Print docker system info