Ref: https://learn.cantrill.io/courses/docker-fundamentals/lectures/44151210 =OR= https://www.youtube.com/watch?v=m2sT-z_A_Ys
DEMO: https://learn.cantrill.io/courses/docker-fundamentals/lectures/44151211 =OR= https://www.youtube.com/watch?v=fvFknCRf1W0 → GitHub: https://github.com/acantril/docker-fundamentals/blob/main/docker-registry/instructions.md
What is a Container Registry?
- 💡 Similar to GitHub, but instead of Git repositories it stores container images
- Docker Hub
- Most popular container registry
- Public registry
- can be accessed from public internet
- images can be public (shared with everyone) or private (only you)
- 🔧 Stores Docker images in repositories
Pulling and pushing images from/to Docker Hub
- Pull image from Docker Hub:
docker pull acantril/containerofcats:latest
acantril
- Docker Hub user name
containerofcats
- image repo
latest
- image tag
- Push image to Docker Hub:
- You must be a Docker Hub user first (register if you're not)
docker login --username=<user_name>
- login to Docker Hub
docker tag <img_id> <user_name>/<repo_name>:<tag>
- creates a new image with specified tag, ready to be pushed to Docker Hub
docker push <user_name>/<repo_name>:<tag>
- push the image to Docker Hub
- you can verify that image is visible in Docker Hub
- 💡 The imageID of a Docker image is a small subset of an overall digest. The digests determine how registries interact with images and their tags/versions.