Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I update full description on Docker Hub automatically?

I'm using Travis CI for building docker images from Dockerfiles and then pushing them to the Docker Hub on success.

I've created an MD file describing the image and how to use it. I want to have the same description on the Docker Hub in the full description section.

As I may update the description in the future, I want to have Travis CI automatically update the description based on the MD file in the repository with the new image.

Anyone knows how to do this?

like image 549
NEO Avatar asked Jan 10 '16 20:01

NEO


People also ask

Do docker images automatically update?

Your containers are now set up to automatically update whenever you push a new Docker image to your image repository, or when an external maintainer updates an image you're watching.

How do I keep my docker images updated?

# Update your tags manually as needed When a new version comes out, update the tag in your docker-compose. yml , docker-compose pull , and then restart the container ( docker-compose down && docker-compose up -d ). This is simple, and robust, and means nothing will update without you knowing.

How do I automate the process of creating images in docker?

Docker Hub can automatically build images from source code in an external repository and automatically push the built image to your Docker repositories. When you set up automated builds (also called autobuilds), you create a list of branches and tags that you want to build into Docker images.


1 Answers

I have a GitHub Action to do this. https://github.com/peter-evans/dockerhub-description

    - name: Docker Hub Description
      uses: peter-evans/[email protected]
      env:
        DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
        DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
        DOCKERHUB_REPOSITORY: peterevans/dockerhub-description

You can also use it independently of GitHub Actions in other CI tools.

    docker run -v $PWD:/workspace \
      -e DOCKERHUB_USERNAME='user1' \
      -e DOCKERHUB_PASSWORD='xxxxx' \
      -e DOCKERHUB_REPOSITORY='my-docker-image' \
      -e README_FILEPATH='/workspace/README.md' \
      peterevans/dockerhub-description:2.1.0

Note: This does not work if you are using 2 Factor Authentication (2FA) and/or using Personal Access Tokens to authenticate to Docker Hub. You must use your actual Docker Hub password. See issue reported here: https://github.com/docker/hub-feedback/issues/1927

like image 170
peterevans Avatar answered Oct 02 '22 20:10

peterevans