Skip to content

Cannot push docker image into docker hub from Github Action #24693

Discussion options

You must be logged in to vote

Consider using an action to build and push the image. It will be less error prone, it handles the login and any other post actions (logout). I find it easier to maitain:

- name: build image
  id: build-image
  uses: redhat-actions/buildah-build@v2
  with:
    image: myuser/myimage
    tags: latest
    dockerfiles: |
      ./Dockerfile
  • name: push image to ghcr.io
    uses: redhat-actions/push-to-registry@v2
    with:
    image: ${{ steps.build-image.outputs.image }}
    tags: ${{ steps.build-image.outputs.tags }}
    registry: ghcr.io
    username: ${{ github.actor }}
    password: ${{ secrets.GITHUB_TOKEN }}

Replies: 10 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment