GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||
GeezerVison is showing github.com — Add note to sanitize tags by crazy-max · Pull Request #426 · docker/build-push-action Conversation
|
|
Just a note - and maybe I was doing it wrong somehow - but this didn't actually work for me. I kept getting: I ended up using: and referencing as : |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@PromoFaux Looking at your workflow, I suggest to use the metadata action which will automatically sanitize tags: name: Docker on: push: branches: main jobs: docker: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Cache Docker layers uses: actions/[email protected] with: path: /tmp/.docker-buildx-cache key: ${{ runner.os }}-docker-buildx-${{ github.sha }} restore-keys: ${{ runner.os }}-docker-buildx- - name: Login to Github Packages uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Docker meta id: meta uses: docker/metadata-action@v3 with: images: ghcr.io/${{ github.repository }} tags: | sha_${{ github.sha }} latest - name: Build id: docker_build uses: docker/build-push-action@v2 with: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=local,src=/tmp/.docker-buildx-cache cache-to: type=local,dest=/tmp/.docker-buildx-cache |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for the tips, I'll take a look! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
And yes indeed there is an issue with the syntax. It should be: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
AH. I came really close to that solution myself! Rather I tried |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Also, yeah, metadata action works well! I am already using it over on pi-hole/docker-pi-hole - I don't know why I didn't use it in this case. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yeah you can do a bunch of thing with the metadata-action. For example you could merge both nightly and release workflows and the metadata action will take care of tagging properly based on scheduled events, git tag and so on. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Repository/image name should be lowercased automatically in cache parameters.
There was an error while loading. Please reload this page.