I can’t figure how how to get the second script right, after I create the image:
I’m trying to move away from using a script I had been using to build and push docker images where I was using docker/build-push-action.
I don’t care about retaining the old images from GitHub Packages Docker registry. I just want to push a new image to the Google Container Registry at this point.
I am now running a script to create the image myself and push it to the new Google Container Registry route. So here are my new jobs:
build_docker_image_from_artifact: needs: build name: Build a docker image based off the build artifact runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/download-artifact@v2 with: name: dist-artifact path: dist - run: docker build . --file Dockerfile --tag dschinkel/we-do-tdd:latest
Now I’m not really sure what the image name is that it actually creates. I see that it generated a sha or hash or something and my tag.
push ghcr.io/dschinkel/we-do-tdd:latest isn’t quite right though in my next script when trying to reference it:
push_image_to_github_container_registry: needs: login_github_container_registry name: Push Docker image to GitHub Container Repository. Creates a Docker Image Package runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/download-artifact@v2 with: name: dist-artifact path: dist - run: ls dist # ghcr.io/OWNER/IMAGE_NAME.latest - run: docker push ghcr.io/dschinkel/we-do-tdd:latest
Run docker push ghcr.io/dschinkel/we-do-tdd:latest An image does not exist locally with the tag: ghcr.io/dschinkel/we-do-tdd The push refers to repository [ghcr.io/dschinkel/we-do-tdd]
Other Info (in case it helps)
My last push that was using my old script based on docker/build-push-actionthat I built a couple days ago generated this image but not sure what my new script is actually creating because I haven’t packaged it yet:
I took a look at Migrating to GitHub Container Registry for Docker images but not sure if I’m missing something related to that or it’s just a dumb mistake I made above somewhere that I’m just not seeing. I want to think it’s maybe the latter…?