docker / build-push-action

GitHub Action to build and push Docker images with Buildx
https://github.com/marketplace/actions/build-and-push-docker-images
Apache License 2.0
4.36k stars 558 forks source link

Push to Docker Hub done but no new tag created #823

Closed pifou25 closed 1 year ago

pifou25 commented 1 year ago

Hello,

We ran a new github workflow few days ago that should have created 2 new tags into the Docker Hub: jeedom/jeedom:4.4 and jeedom/jeedom:4.4-buster

Expected to be published there : https://hub.docker.com/r/jeedom/jeedom/tags

Both seems OK on the Github workflow logs (you may check https://github.com/jeedom/core/actions/runs/4271294005) But nothing yet visible on the jeedom docker hub, it may take a long time before the repo to be updated with new images / tags ?

#18 exporting to image
#18 pushing layers 25.1s done
#18 pushing manifest for docker.io/***/jeedom:4.4-buster
#18 pushing manifest for docker.io/***/jeedom:4.4-buster 0.7s done
#18 DONE 136.6s

The related step (you may check the complete workflow here https://github.com/jeedom/core/blob/alpha/.github/workflows/docker-image-latest.yml )

      - name: Build and push Jeedom on Debian:Buster
        # https://github.com/marketplace/actions/build-and-push-docker-images
        uses: docker/build-push-action@v3
        # continue-on-error: true
        with:
          context: ./
          file: ./Dockerfile
          platforms: linux/amd64,linux/arm64 # ,linux/arm/v7
          push: true
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache
          build-args: |
            "VERSION=${{ env.GITHUB_BRANCH }}"
            "DEBIAN=buster"
          tags: |
            "${{ secrets.DOCKER_HUB_USERNAME }}/jeedom:${{ env.JEEDOM_SHORT_VERSION}}-buster"

I don't know how to investigate about that, is it possible that there is some kind of uncaught exception during the workflow and then, is it possible to run it again with extra logs ? On the other hand, is it possible that the new tag creation fall in queue into the dockerhub, and there is some monitoring about that ?

Any help and suggestion welcome, I already tried the same workflow in my own forked Github repo (pifou25/jeedom-core) that successfully created the tag (into dockerhub pifou25/jeedom:4.4-buster) so I guess the issue is not on the action, but don't know where to investigate.

crazy-max commented 1 year ago

Looks like you're missing one:

          tags: |
            "${{ secrets.DOCKER_HUB_USERNAME }}/jeedom:${{ env.JEEDOM_SHORT_VERSION}}"
            "${{ secrets.DOCKER_HUB_USERNAME }}/jeedom:${{ env.JEEDOM_SHORT_VERSION}}-buster"
pifou25 commented 1 year ago

Looks like you're missing one:

          tags: |
            "${{ secrets.DOCKER_HUB_USERNAME }}/jeedom:${{ env.JEEDOM_SHORT_VERSION}}"
            "${{ secrets.DOCKER_HUB_USERNAME }}/jeedom:${{ env.JEEDOM_SHORT_VERSION}}-buster"

No, this is not the same image, the tag 4.4 is a Debian Bullseye version (the default one) but the version with -buster suffix is the image based on Debian Buster base. Both images seems ok in the workflow, in 2 separate steps, but none of these images are pushed to Docker Hub until now...

crazy-max commented 1 year ago

Sorry I was looking at the description of your issue that only have a single step to push the image. After looking at your complete worklow in https://github.com/jeedom/core/blob/alpha/.github/workflows/docker-image-latest.yml I see two steps pushing an image:

      - name: Build and push Jeedom on DockerHub
        # https://github.com/marketplace/actions/build-and-push-docker-images
        uses: docker/build-push-action@v3
        # continue-on-error: true
        with:
          context: ./
          file: ./Dockerfile
          platforms: linux/amd64,linux/arm64 # ,linux/arm/v7
          push: true
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache
          build-args: "VERSION=${{ env.GITHUB_BRANCH }}"
          tags: |
            "${{ env.JEEDOM_TAGS }}"
      - name: Build and push Jeedom on Debian:Buster
        # https://github.com/marketplace/actions/build-and-push-docker-images
        uses: docker/build-push-action@v3
        # continue-on-error: true
        with:
          context: ./
          file: ./Dockerfile
          platforms: linux/amd64,linux/arm64 # ,linux/arm/v7
          push: true
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache
          build-args: |
            "VERSION=${{ env.GITHUB_BRANCH }}"
            "DEBIAN=buster"
          tags: |
            "${{ secrets.DOCKER_HUB_USERNAME }}/jeedom:${{ env.JEEDOM_SHORT_VERSION}}-buster"

For the first one the image is pushed: https://github.com/jeedom/core/actions/runs/4271294005/jobs/7435664817#step:8:17895

#17 exporting to image
#17 pushing layers 23.6s done
#17 pushing manifest for docker.io/***/jeedom:4.4@sha256:285b1b3b50ebc593cd42a32018ad97bf4f5ac4daa71dde3d85a8a8c4797526cf
#17 pushing manifest for docker.io/***/jeedom:4.4@sha256:285b1b3b50ebc593cd42a32018ad97bf4f5ac4daa71dde3d85a8a8c4797526cf 0.7s done
#17 DONE 141.4s

And second one too: https://github.com/jeedom/core/actions/runs/4271294005/jobs/7435664817#step:9:17990

#18 exporting to image
#18 pushing layers 25.1s done
#18 pushing manifest for docker.io/***/jeedom:4.4-buster@sha256:6ef4782d2e795e760e13ab10eb1745662da231c078a9b72d39aa5f0ea9f7678c
#18 pushing manifest for docker.io/***/jeedom:4.4-buster@sha256:6ef4782d2e795e760e13ab10eb1745662da231c078a9b72d39aa5f0ea9f7678c 0.7s done
#18 DONE 136.6s

I'm not sure where though as the slug is redacted: docker.io/***/jeedom. Are you sure the value of ${{ secrets.DOCKER_HUB_USERNAME }} is jeedom?

crazy-max commented 1 year ago

Looking on Docker Hub, looks to be here: https://hub.docker.com/r/pifou25/jeedom/tags so best guess is your secret is wrong.

pifou25 commented 1 year ago

I forked the Github repo jeedom/core into my own under pifou25/jeedom-core, then created this workflow and tested it with success. So these images at pifou25/jeedom/tags comes from my own tests, but I expected when I made the PR into jeedom github repo, that the workflow will take secrets from jeedom account, not my own, I didn't share my docker secrets with jeedom.

Anyway you 're right :) as long as there is no error, it was just a matter of finding where that was pushed, and I think I found it: https://hub.docker.com/r/zoic21/jeedom/tags