Skip to content

Instantly share code, notes, and snippets.

@seyuf
Last active September 18, 2019 14:20
Show Gist options
  • Save seyuf/90bbe1bc42c7825184aecd1cc4924e4e to your computer and use it in GitHub Desktop.
Save seyuf/90bbe1bc42c7825184aecd1cc4924e4e to your computer and use it in GitHub Desktop.
Trick Github Actions: Pull docker image from private registry
- uses: docker://[ref-to-public-image]
- name: "pull private image and retag it"
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_REGISTRY_URL: ${{ secrets.DOCKER_REGISTRY_URL }}
run: |
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" ${{ secrets.DOCKER_REGISTRY_URL }}
docker pull [url-of-private-image]
docker tag [url-of-private-image] [ref-to-public-image]
- name: 'this step will be using the private image'
uses: docker://[ref-to-public-image]
with:
entrypoint: /bin/bash
args: random-script.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment