Cloud Native 5 min read

Master Docker Commands: Images, Pull, Save, Load, Run, and Manage Containers

This guide explains the difference between Docker image and images, demonstrates how to list, pull, save, load, and remove images, and shows how to run, start, stop, and list containers using essential Docker commands.

Raymond Ops
Raymond Ops
Raymond Ops
Master Docker Commands: Images, Pull, Save, Load, Run, and Manage Containers

docker image vs images

Docker images can be used directly, while the singular docker image command is for managing images and cannot list them directly. Example output of docker images shows available images.

# docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
busybox      latest    a9d583973f65   2 years ago   1.23MB
nginx        latest    298ec0e28760   2 years ago   133MB

docker pull

The docker pull command downloads a specified image to the local host.

# docker pull alpine
Using default tag: latest
latest: Pulling from library/alpine
ca3cd42a7c95: Pull complete
Digest: sha256:e103c1b4bf019dc290bcc7aca538dc2bf7a9d0fc836e186f5fa34945c5168310
Status: Downloaded newer image for alpine:latest

docker save

docker save

exports an image to a tar archive file.

# docker save busybox > busybox.tar
# ls
busybox.tar

docker load

docker load

imports a tar archive created by docker save as a Docker image.

# docker load -i busybox.tar
2983725f2649: Loading layer 1.45MB/1.45MB
Loaded image: busybox:latest

docker rmi

docker rmi

removes one or more images from the local registry.

# docker rmi alpine
Untagged: alpine:latest
Untagged: alpine@sha256:e103c1b4bf019dc290bcc7aca538dc2bf7a9d0fc836e186f5fa34945c5168310
Deleted: sha256:49f356fa4513676c5e22e3a8404aad6c7262cc7aaed15341458265320786c58c

docker run

docker run

creates and starts a new container from an image. Options -itd allocate a pseudo‑TTY, keep STDIN open, and run in detached mode.

# docker run -itd nginx
4c45f7885e57...

docker start | stop

docker start

starts a stopped container; docker stop stops a running container.

# docker stop bold_shockley
# docker start bold_shockley

docker ps

docker ps

lists running containers; adding -a shows all containers, including stopped ones.

# docker ps
# docker ps -a
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DockerCommandLineContainerManagementImageManagement
Raymond Ops
Written by

Raymond Ops

Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.