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.

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