Skip to content

Can't cache to artifact registry #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dmzrio opened this issue Nov 5, 2024 · 1 comment
Open

Can't cache to artifact registry #27

dmzrio opened this issue Nov 5, 2024 · 1 comment

Comments

@dmzrio
Copy link

dmzrio commented Nov 5, 2024

I try use this apps, but failed to store cache.
what i'm missing?

My env setup.

      - name: DOCKER_INSECURE_REGISTRY
        value: "127.0.0.1:1234"
        
      - name: DOCKER_REGISTRY_MIRROR
        value: "http://127.0.0.1:1234"
      
      - name: PROXY_LISTEN
        value: "127.0.0.1:1234"
      
      - name: PROXY_REGISTRY
        value: "https://asia-southeast1-docker.pkg.dev/example/public"

github action

steps:
   - name: Authenticate to Google Cloud with SA
      uses: google-github-actions/auth@v2
      with:
        project_id: ${{ inputs.project_id }}
        credentials_json: ${{ inputs.credentials_json }}
        
    - name: Setup gcloud
      uses: google-github-actions/setup-gcloud@v2
      with:
        install_components: ${{ inputs.gcloud_components }}

    - name: Register gcloud as a docker credential helper
      shell: bash
      run: |-
        gcloud auth configure-docker ${{ inputs.artifact_registry_host }} --project ${{ inputs.project_id }} --quiet

      - name: gcp-artifact-registry-docker-proxy
        run: |
          wget https://github.com/persona-id/gcp-artifact-registry-docker-proxy/releases/download/v1.4.0/gcp-artifact-registry-docker-proxy_Linux_x86_64.tar.gz
          tar -zxvf gcp-artifact-registry-docker-proxy_Linux_x86_64.tar.gz
          ./gcp-artifact-registry-docker-proxy &

      - run: docker pull nginx:latest

i try run this workflow, but nginx:latest doesn't cache to my artifact registry.

@drcapulet
Copy link
Contributor

Hey @dmzrio,

Apologies for the delay - we don't actively watch for issues here. I would not expect you to need to run gcloud auth configure-docker given this service will lookup GCP credentials in the known paths and not use Docker's authentication. My best guess to your issue is that DOCKER_REGISTRY_MIRROR needs the same suffix with your GCP project name and repository name - with your example, that'd be http://127.0.0.1:1234/example/public.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants