Skip
Arish's avatar

6. Pulling and Managing Images


Pulling Images

bash
1# Pull latest
2docker pull nginx
3
4# Pull specific version
5docker pull nginx:1.24
6
7# Pull from different registry
8docker pull gcr.io/google-containers/nginx

Listing Images

bash
1# List all images
2docker images
3
4# Filter by name
5docker images nginx
6
7# Show image IDs only
8docker images -q

Removing Images

bash
1# Remove single image
2docker rmi nginx:1.24
3
4# Remove multiple
5docker rmi nginx redis postgres
6
7# Remove unused images
8docker image prune
9
10# Remove all images
11docker rmi $(docker images -q)

Image Details

bash
1# Inspect image
2docker inspect nginx
3
4# View image history
5docker history nginx
6
7# Check image size
8docker images --format "{{.Repository}}:{{.Tag}} {{.Size}}"

Saving and Loading

bash
1# Save to file
2docker save nginx > nginx.tar
3
4# Load from file
5docker load < nginx.tar