Operations 10 min read

Speed Up Docker Pulls and Master Container Management with Simple Commands

This guide shows how to configure Docker registry mirrors for faster image pulls, run and manage containers—including starting, inspecting, networking, and file editing—using concise command‑line examples and practical tips for Linux environments.

Raymond Ops
Raymond Ops
Raymond Ops
Speed Up Docker Pulls and Master Container Management with Simple Commands

2. Pull an Image

Example: pull the latest Nginx image.

docker pull nginx

3. First Run of the Image

Run the container in detached mode and map host port 8090 to container port 80:

docker run -d -p 8090:80 --name nginx-container nginx:latest

Sample output shows the container ID and confirms it is running.

4. Inspect Command

docker inspect

provides detailed information about containers, images, networks, volumes, etc.

docker inspect nginx-container

5. Start an Existing Container

docker start <container_id_or_name>
# or restart
docker restart <container_id_or_name>

6. List Containers

docker ps          # running containers
docker ps -a       # all containers

7. Stop a Container

docker stop <container_id_or_name>

8. Enter a Container

docker exec -it <container_id_or_name> /bin/bash

Exiting the shell does not stop the container.

9. View Container Processes

docker top <container_name>

10. Delete a Container

docker stop <container_id_or_name>
docker rm <container_id_or_name>
# Remove all stopped containers
docker rm $(docker ps -aq)

11. List Images

docker images

12. Start All Containers

docker start $(docker ps -a -q)

13. Modify Files Inside a Container

Method 1: Use docker exec with an editor (e.g., vi).

docker exec -it <container_id_or_name> bash
# then edit files inside the container

Method 2: Copy files out, edit on the host, and copy back.

docker cp <container_id_or_name>:/path/to/file /host/path
# edit the file on the host
docker cp /host/path/file <container_id_or_name>:/path/to/file

14. Create a Container with a Specific IP

Docker’s default bridge network assigns IPs automatically. For fixed IPs, create a custom bridge network and run the container on it.

docker network create --driver bridge --subnet 172.19.0.0/16 --gateway 172.19.0.1 mynet

15. View Network Modes

docker network ls

16. Create a New Bridge Network

docker network create --driver bridge --subnet 172.19.0.0/16 --gateway 172.19.0.1 dockercompose

17. Inspect Network Details

docker network inspect dockercompose

18. Run a Container on the Custom Network with a Fixed IP

docker run -it --name nginx-second --network=dockercompose --ip 172.19.0.6 nginx

Verify the IP with:

docker inspect <container_id> | grep "IPAddress"

19. View Volume Information

docker inspect -f {{.Volumes}} <container_name>

These commands cover common Docker operations for image acceleration, container lifecycle management, networking, and file handling.

Nginx running in browser
Nginx running in browser
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.

DockerLinuxContainerregistry-mirror
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.