Last active
September 18, 2019 14:20
-
-
Save seyuf/90bbe1bc42c7825184aecd1cc4924e4e to your computer and use it in GitHub Desktop.
Trick Github Actions: Pull docker image from private registry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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