jokkedk/webgrind

Docker image still on 1.8

jorrit opened this issue ยท 12 comments

First of all, thanks for this great tool!

One of the nicest things is that I can easily run it with Docker, without installing anything. However, the Docker image is still on 1.8. Could it be updated so it uses 1.9? Thanks!

Hmm thought it was supposed to auto update. I do not have write access to Docker; @jokkedk could you take a look into it?

This is probably due to the fact that DockerHub removed free automated builds for open source projects (due to cryptominer abuse) in June 2021. This blog post has more details: https://www.docker.com/blog/changes-to-docker-hub-autobuilds/.

It's very easy to use GitHub Actions to update DockerHub images (see, e.g., smrealms/smr@25776ee), but you do need to store the DockerHub credentials as repository secrets. I'm happy to help with a PR, but we probably still need @jokkedk's attention on this either way.

I'm totally ignorant when it comes to Docker images, but is there any way to force 1.9 via docker-compose?

Apologies for much lag. I am not sure what I ned to do to get Docker to update. Any pointers appreciated.

No stress.

As @hemberger says, it looks like the docker image has to use GitHub Actions to be created. You need access to create GitHub repo secrets for use in the action.

Approach 2 from this article looks promising: https://davelms.medium.com/build-your-docker-images-automatically-when-pushing-new-code-to-github-394f4c1679cc

@jokkedk I'd be happy to help out however I can. If you go to Settings โž” Secrets โž” Actions, you can add your Dockerhub credentials to the "Repository secrets" as, e.g., DOCKERHUB_TOKEN and DOCKERHUB_USERNAME.

Then you can add a GitHub Action to push to DockerHub on release by creating a file, e.g. .github/workflows/build-release.yml. The simplest example would be:

name: Build Release

on:
  release:
    types: [published]

jobs:
  build-release:
    runs-on: ubuntu-20.04
    steps:
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1

      - name: Login to DockerHub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Build and push image 
        uses: docker/build-push-action@v2
        with:
          push: true
          tags: jokkedk/webgrind:latest

If it would help, I can submit this as a PR, but we would probably need some back-and-forth to get this all configured properly to your liking.

I just forked this repo and created a DockerHub repo and can confirm that I have 1.9 working on my fork using @hemberger 's instructions ( there is a typo present in the above .yaml).

Full Instructions:

  1. Log into DockerHub
  2. In your user account menu (top right avatar) go to Account Settings
  3. Go to Security > Add New Access Token call it "GitHub Actions" or whatever
  4. Make a note of your access token
  5. Go to this repo's Github Secrets
  6. Add two new secrets: DOCKERHUB_USERNAME and DOCKERHUB_TOKEN (the access token recently copied from DockerHub)
  7. Create the file .github/workflows/build-release.yml
name: Build Release

on:
  release:
    types: [published]

jobs:
  build-release:
    runs-on: ubuntu-20.04
    steps:
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1

      - name: Login to DockerHub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Build and push image 
        uses: docker/build-push-action@v2
        with:
          push: true
          tags: jokkedk/webgrind:latest
  1. Then tag and publish a new release of this repo, the Docker image action will run and push the image to Docker.
  2. ๐Ÿ’ท Profit then ๐Ÿฅณ party.

( there is a typo present in the above .yaml)

The typo has been fixed, and now our snippets are identical. Thanks for pointing it out (and for the additional testing)!

Any progress here?

Thank you for helping!
I've set up the action and tagged a new release. Seems to be working ๐Ÿฅณ

Ideally the action would mark the docker image with the release tag, e.g. v1.9.1, but at least it is updating now. It should be possible to grab tags with docker/metadata-action.

Ideally the action would mark the docker image with the release tag, e.g. v1.9.1, but at least it is updating now. It should be possible to grab tags with docker/metadata-action.

I've submitted a PR that should do this, I don't have a great way to test it though.