Docker push to GitHub Container Registry (ghcr.io)

Make a note of the address as it is long and forgotten.

The format of the docker tag command follows the following.

docker tag <Container name> ghcr.io/<GitHub username>/<package name>/<Container name>:<tag>

For example:

$ docker images
REPOSITORY                           TAG                                              IMAGE ID            CREATED             SIZE
stns-build                           latest                                           449f1c2d3562        4 minutes ago       35.4MB

$ docker tag stns-build:latest ghcr.io/tomoyk/stns-client/stns-client:v0.1

$ docker images
REPOSITORY                               TAG                                              IMAGE ID            CREATED             SIZE
stns-build                               latest                                           449f1c2d3562        6 minutes ago       35.4MB
ghcr.io/tomoyk/stns-client/stns-client   v0.1                                             449f1c2d3562        6 minutes ago       35.4MB

Finally push.

docker push ghcr.io/tomoyk/stns-client/stns-client:v0.1

If it is played, look at ~ / .docker / config.json. Make sure there is ghcr.io under auths.

{
    "auths": {
        "ghcr.io": {
            "auth": "xxxx"
        }
     }
}

If not, issue a Personal Access Token from the GitHub Web UI.

image.png

Save Token as ~ / TOKEN.txt and execute the following command.

cat ~/TOKEN.txt | docker login https://ghcr.io -u <User name> --password-stdin

Execute docker push xxx again.

Recommended Posts

Docker push to GitHub Container Registry (ghcr.io)
Steps to push Docker image to GitHub Container Registry (ghcr.io)
Push Docker images from GitHub Actions to GitHub Container Registry
Minimal Workflow to push Docker image to Github Container Registry with Github Actions
Test, build, and push your Docker image to GitHub Container Registry using GitHub Actions
Migrate Dockerhub images to Github Container Registry
[GCP] Until you push the local Docker image to the Container Registry
Until you push to Github
[Personal notes] How to push a Docker image to GitHub Packages
Getting Started with GitHub Container Registry instead of Docker Hub
Introduction to Linux Container / Docker (Part 1)
How to push from Tarminal to GitHub
Introduction to Linux Container / Docker (Part 2)
Pass environment variables to docker container
[Docker] Operation up to container creation # 2
The story of pushing a Docker container to GitHub Package Registry and Docker Hub with GitHub Actions
Publish Docker Image on GitHub Package Registry
[Docker] Copy files from docker container to host
Docker container build fails to install php-radis
Introduction to Docker / Kubernetes Practical Container Development
Push the Docker Image distributed by Docker Hub to Google Container Registry and start the VM based on that Image
How to check the logs in the Docker container
How to get a heapdump from a Docker container
Setting to exit from Docker container with VScode
Copy files from docker container to host (docker cp)
I made a Docker container to run Maven
How to update pre-built files in docker container
Small Docker container
Push the image to docker hub using Jib
How to push an app developed with Rails to Github
Create a Docker container to convert EPS to PGF source
GitHub Actions/Cache: Cache bundle installed gems on Docker container
How to install Docker
Docker container usage scene
I want to push an app made with Rails 6 to GitHub
Wait for the container service to start with docker healthcheck
Confirm public key ~ Register key on Github ~ Push Rails app to Github
[Docker] How to access the host from inside the container. http://host.docker.internal: