Scope

GitHub Container Registry uses ghcr.io. The earlier docker.pkg.github.com instructions have been removed.

Local CLI Example

Inject tokens through secret storage or an equivalent mechanism; do not write them directly into command history.

printf '%s' "$GHCR_TOKEN" | docker login ghcr.io -u "$GHCR_USER" --password-stdin
docker build -t ghcr.io/<OWNER>/<IMAGE>:<TAG> .
docker push ghcr.io/<OWNER>/<IMAGE>:<TAG>
docker logout ghcr.io

Replace OWNER and IMAGE with actual lowercase paths. Deploy verified tags or digests.

CI

Consider GITHUB_TOKEN with the required packages permissions in GitHub Actions. Check package visibility and linked-repository permissions. Verify storage and transfer terms rather than assuming all usage is free.

Official References

GitHub Container registry

Related Blog Reading Notes

Powered by Fruition