Migrate Dockerhub images to Github Container Registry

This is a personal note when migrating images from Dockerhub to Github Container Registry.

background

https://github.blog/2020-09-01-introducing-github-container-registry/ Try using the GitHub Container Registry (henceforth, ghcr) released on 9/1. Currently (2020/09/03) it is a public beta version, so it is subject to change.

Container image saved in Docker Hub, delete if not used for 6 months with free plan-Publickey Also, the specification has been changed so that containers that are not used in the free plan of Dockerhub will be deleted.

In other words "The demand for Docker Hub has increased and there are more restrictions, so if you have a free plan, use Github Container Registry."

Prerequisites

--Registered on Github --Creating a personal access token --Packages have read, write, delete permissions

Log in to ghcr with the following command

dockerer login ghcr.io -u $OWNER #Github account name
Password: <Enter your personal access token as your password> 
Login Succeeded

Migrate from Docker Hub with the following command

docker pull $OWNER/$IMAGE_NAME:$VERSION
docker tag $OWNER/$IMAGE_NAME:$VERSION ghcr.io/$OWNER/$IMAGE_NAME:$VERSION
docker push ghcr.io/$OWNER/IMAGE_NAME:$VERSION

Set the container image pushed to ghcr to Public and check that you can docker pull

docker pull ghcr.io/$OWNER/$IMAGE_NAME:$VERSION

Reference Introduction to GitHub Container Registry
Public Beta of GitHub Container Registry Released-GitHub Blog

Recommended Posts

Migrate Dockerhub images to Github Container Registry
Push Docker images from GitHub Actions to GitHub Container Registry
Docker push to GitHub Container Registry (ghcr.io)
Steps to push Docker image to GitHub Container Registry (ghcr.io)
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 from JUnit 4 to JUnit 5
The story of pushing a Docker container to GitHub Package Registry and Docker Hub with GitHub Actions
Getting Started with GitHub Container Registry instead of Docker Hub