What is docker pull and docker push?
Answer
docker pull downloads a Docker image from a registry to your local machine. Syntax: docker pull image[:tag]. Examples: docker pull nginx:1.25 — pull specific version (always pin versions!); docker pull node:20-alpine; docker pull ghcr.io/username/myapp:1.0 — from GitHub Container Registry. Docker pull only downloads layers not already cached locally — subsequent pulls of images sharing layers are fast. For multi-platform: docker pull --platform linux/amd64 node:20. docker push uploads a local image to a registry. You must be authenticated and the image must be tagged with the full registry path. Steps: (1) Login: docker login (Docker Hub) or docker login ghcr.io -u username --password-stdin; (2) Tag: docker tag myapp:1.0 ghcr.io/username/myapp:1.0; (3) Push: docker push ghcr.io/username/myapp:1.0. Docker pushes only layers not already in the registry. Multiple tags: you can push the same image with different tags: docker tag myapp:1.0 myapp:latest && docker push myapp:latest. Efficient workflow in CI/CD: build → tag → push to registry → trigger deployment (pull from registry to target servers or Kubernetes).