Skip to content
Docker

Image Management

Pull, list, tag, push, and prune images.

By EZ4Code Team
imageregistrymaintenance

Code

# Pull and list images
docker pull postgres:16-alpine
docker images

# Tag and push to a registry
docker tag myapp:1.0 registry.example.com/myapp:1.0
docker push registry.example.com/myapp:1.0

# Inspect and history
docker inspect postgres:16-alpine
docker history myapp:1.0

# Remove unused images
docker image prune -a
docker rmi myapp:1.0

Explanation

Images are read-only templates composed of layers stacked on top of a base. docker tag creates an alias for an image, enabling push to a custom registry. image prune -a removes all unused images to reclaim disk space.

More Docker Snippets