How to push a docker image with README file to docker hub?

dockerhub-description GitHub Action can update the Docker Hub description from a README.md file.

    - name: Docker Hub Description
      uses: peter-evans/dockerhub-description@v3
      with:
        username: ${{ secrets.DOCKERHUB_USERNAME }}
        password: ${{ secrets.DOCKERHUB_PASSWORD }}
        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

docker-pushrm is a Docker CLI plugin that adds a new docker pushrm (speak: push readme) command to Docker. When it's installed you can push a README to Docker Hub, Quay or Harbor with:

$ ls
README.md
$ docker pushrm my-user/my-repo

It uses the the logins from Docker's credentials store, so it "just works" for registries that you're already logged into. I use it both interactively and for CI. There's also a github action based on it.


Docker Hub will try to parse your Readme.md iff you're doing an "Automated Build." For manual builds (where you push your own image), Docker Hub does not peek inside your image source code repository and has no way to know about your Readme. You'll need to manually add your Readme text to the Information section