October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

Docker Cheat Sheet: Essential Commands for 2026

Learn the essential Docker commands for 2026, including image builds, container lifecycle management, port publishing, volumes, networks, troubleshooting, and Compose.
Length9 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Docker’s essential workflow is straightforward: obtain or build an image, create and start a container with docker run, inspect its output, connect to it when necessary, and remove or restart it when the task is finished. For multi-container applications, use Docker Compose: docker compose up -d starts the application, logs and exec help you operate it, and down tears it down.

The distinction that prevents many mistakes is lifecycle-related: docker run creates a new container, while docker start starts an existing stopped container. The commands below are organized around the decisions you make while developing, testing, and operating containers.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start by checking the Docker CLI

Use these commands to confirm that the Docker client is installed, the engine is reachable, and a particular command is available:

docker --version
docker version
docker info
docker <command> --help
  • docker --version prints the client version.
  • docker version reports client and server information, which can reveal a daemon or compatibility problem.
  • docker info displays engine details and configured resources.
  • Appending --help to a command displays its options and syntax. For example, docker run --help is the quickest way to check a flag before using it.

If docker version cannot contact the server, fix the Docker engine or desktop service before troubleshooting an image or container.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Understand Docker’s resource types

An image is the packaged filesystem and metadata used to create containers. A container is a runnable instance of an image. A volume stores data outside a container’s writable layer, while a network controls how containers reach one another. Compose groups those resources into a repeatable, multi-service application definition.

This model explains why deleting a container does not necessarily delete a named volume, and why rebuilding an image does not automatically replace a container that was created from an older image. Keep the resource type in mind when choosing a command.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Download, inspect, tag, and build images

Pull an existing image

docker pull IMAGE[:TAG]

docker pull downloads an image and its layers from the configured registry. Include a tag when you need a specific image variant; otherwise Docker uses the registry’s default tag behavior.

List local images

docker images
docker image ls

These are equivalent listing forms. To inspect the metadata and configuration of one image, use:

docker image inspect IMAGE

Build from a Dockerfile

docker build -t NAME:TAG .

The final dot is the build context, normally the current directory. The -t option assigns a repository name and tag so that later commands can refer to the result predictably.

Use the extended form when the build needs explicit controls:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
docker image build --file Dockerfile -t NAME:TAG .
docker build --pull --no-cache --platform linux/amd64 --target production -t NAME:TAG .
  • --file selects a Dockerfile whose name or location differs from the default.
  • --pull checks for newer versions of base images.
  • --no-cache disables reuse of previous build layers, useful when cached output is suspect.
  • --platform selects the target platform, such as linux/amd64.
  • --target stops at a named stage in a multi-stage Dockerfile.

Use docker image inspect after a build when you need to verify the image’s entrypoint, architecture, labels, or other metadata.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Tag and publish an image

docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
docker push NAME:TAG

docker tag adds another reference to the same local image; it does not rebuild it. Push only after the target name and tag identify the registry location you intend to publish.

Run and manage containers

Create and start a new container with docker run

docker run --name NAME IMAGE
docker run -d --name NAME -p 8080:80 IMAGE

docker run creates a new container and starts it. If the image is not local, Docker pulls it first. In the second example, -d runs in detached mode and -p 8080:80 publishes host port 8080 to container port 80.

List running and stopped containers

docker ps
docker ps -a

docker ps shows running containers. Add -a to include containers that have exited or were stopped. This is essential when a command appears to have “disappeared”: it may still exist but be stopped.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the right lifecycle command

Command What it does Creates a container? Typical use
docker run Creates and starts a container from an image, pulling the image if needed. Yes First launch or a deliberately new instance.
docker start Starts an existing stopped container. No Resume a container listed by docker ps -a.
docker stop Requests a graceful stop. No Normal shutdown.
docker restart Stops and starts the same container. No Apply a simple restart without recreating it.
docker kill Immediately terminates the container. No Emergency recovery when graceful stopping fails.
docker rm Removes a stopped container. No Delete an obsolete instance; recreate it with docker run when needed.

Stopping or removing a container is not the same as deleting a named volume mounted into it. Treat container lifecycle and data lifecycle as separate decisions.

Observe a container

docker logs CONTAINER
docker logs -f CONTAINER
docker inspect CONTAINER
docker stats CONTAINER
  • docker logs prints the container’s recorded standard output and error.
  • docker logs -f follows new output until you stop following it.
  • docker inspect returns detailed configuration and runtime metadata.
  • docker stats shows live resource usage for running containers.

Publish ports and persist data

Map a host port to a container port

docker run -p 127.0.0.1:8080:80 IMAGE

The syntax is host-address:host-port:container-port. Binding to 127.0.0.1 keeps the published service reachable only from the Docker host. If you omit the address, Docker can publish on the host’s available interfaces, which is a broader exposure than many local development tasks require.

Use explicit --mount syntax

The current run reference supports the older -v/--volume form, but --mount makes the mount type and paths explicit:

docker run --mount type=bind,src=$PWD,dst=/app IMAGE
docker run --mount type=volume,src=DATA,dst=/var/lib/data IMAGE
  • A bind mount maps a host directory, such as the current project directory, into the container.
  • A named volume is managed by Docker and is suitable for data that should survive container replacement.
  • A tmpfs mount stores temporary data in memory and disappears when the container stops.

Create and manage a named volume independently when you want its lifecycle to be obvious:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
docker volume create DATA
docker volume ls
docker volume inspect DATA
docker volume rm DATA

Before removing a volume, verify that no application still needs its contents. A container can be safely recreated while the data remains in the named volume, provided the replacement mounts the same volume at the expected path.

Enter a container, run commands, and copy files

Open an interactive shell

docker exec -it CONTAINER sh
docker exec -it CONTAINER bash

docker exec runs a command in an already-running container. Use sh when the image does not include Bash. The -i and -t options keep the session interactive and allocate a terminal.

Run a single command

docker exec CONTAINER COMMAND

This is useful for a quick health check, listing a directory, or invoking an application-specific administrative command without opening a shell.

Copy files between host and container

docker cp CONTAINER:/path ./local-path
docker cp ./local-path CONTAINER:/path

Use docker cp for one-off extraction or injection. For repeatable configuration and application data, prefer an image layer, a bind mount, a named volume, or the Compose file rather than manually copying files after every deployment.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Commit only as an exceptional snapshot

docker commit CONTAINER IMAGE:TAG

Committing captures a container’s current filesystem as a new image. It can preserve an emergency state, but it is not a substitute for a reproducible Dockerfile and version-controlled configuration.

Connect containers with networks

docker network ls
docker network create APP-NET
docker run -d --network APP-NET --name APP IMAGE
docker network connect APP-NET CONTAINER
docker network disconnect APP-NET CONTAINER
docker network inspect APP-NET
docker network rm APP-NET

A user-created bridge network provides DNS resolution by container name. Containers attached to the same network can communicate using names such as APP instead of relying on changing IP addresses. Use docker network inspect to confirm membership and configuration before diagnosing a connection failure.

Attach an existing container with docker network connect when it needs access to another network, and disconnect it when that relationship is no longer required. Remove a network only after its containers have been disconnected.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use Docker Compose for multi-container applications

Compose defines and runs multi-container applications from a Compose file. Start by validating the file and checking the Compose plugin:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
docker compose version
docker compose config

docker compose config renders and validates the effective configuration, making it useful for catching malformed YAML or unexpected variable interpolation before startup.

Normal Compose lifecycle

docker compose pull
docker compose build
docker compose up
docker compose up -d
docker compose ps
docker compose logs -f SERVICE
docker compose exec SERVICE COMMAND
docker compose restart SERVICE
docker compose stop
docker compose down
  1. Run docker compose pull when services use images that should be downloaded from a registry.
  2. Run docker compose build when services are built locally.
  3. Use docker compose up in the foreground when you want attached logs, or docker compose up -d to leave services running in the background.
  4. Check service state with docker compose ps.
  5. Follow one service’s output with docker compose logs -f SERVICE.
  6. Run an administrative command inside a running service with docker compose exec SERVICE COMMAND.
  7. Use docker compose stop for a reversible stop, and docker compose down to stop and remove the application’s containers and networks.

Add --build to docker compose up when images should be rebuilt before startup. If service configuration or images changed, Compose can stop and recreate containers while preserving mounted volumes.

Compose builds accept controls including --no-cache, --pull, --push, --sbom, --provenance, and --with-dependencies:

docker compose build --no-cache --pull --with-dependencies

docker compose up versus docker compose run

Command Purpose Ports Scope
docker compose up Creates and starts the application’s configured services. Publishes configured service ports. Normal application lifecycle.
docker compose run --rm SERVICE COMMAND Starts a one-off container for a task such as a migration or shell. Does not publish the service’s configured ports unless --service-ports is supplied. Single task; --rm removes the temporary container afterward.

Use docker compose run --rm SERVICE COMMAND for an isolated maintenance command, not as a replacement for bringing up the complete application.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Compose networking

Compose normally creates one default network for an application. Each service container joins that network and is reachable by the service name, so an application can connect to a database at a hostname such as db rather than a hard-coded container IP.

Define named networks in the Compose file when you need explicit segmentation, such as separating a front tier from a back tier. Services must share a network to communicate through that network.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Inspect usage and clean up safely

docker system df
docker system prune
docker container prune
docker image prune
docker volume prune
docker network prune
docker events
docker inspect CONTAINER_OR_IMAGE

Start with docker system df to see where disk space is being used. Use the narrower prune command that matches the resource you intend to remove:

  • docker container prune removes stopped containers.
  • docker image prune removes unused image data according to the command’s selection rules.
  • docker volume prune can delete unused volumes and therefore deserves the greatest caution.
  • docker network prune removes unused networks.
  • docker system prune combines cleanup categories and can remove more than expected.

Inspect the output and confirm what is unused before approving any prune operation, particularly when volumes contain databases or other persistent state. Run docker events in a separate terminal when you need a live stream of engine events while reproducing a failure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Fast troubleshooting paths

The container is not listed

Run docker ps -a. If the container exists but is stopped, use docker start CONTAINER. If it does not exist, use docker run and verify the image name, ports, mounts, and network options.

The service starts and exits

Read docker logs CONTAINER, then use docker inspect CONTAINER to check its configured command and state. A foreground process that exits normally will also end the container; restarting it does not change that command.

A published port cannot be reached

Confirm the mapping in the original docker run command or Compose configuration, check that the container is running with docker ps, and remember that a binding such as 127.0.0.1:8080:80 is intentionally local-only. For a Compose one-off task, use --service-ports with docker compose run if the task must expose the service’s configured ports.

Containers cannot find one another

Verify that both containers are attached to the same user-created network with docker network inspect APP-NET. In Compose, use the service name on the shared default or named network; do not depend on a container IP that can change when Compose recreates a service.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Printable command reference

Need Command
Check installation docker version
Find stopped containers docker ps -a
Build an image docker build -t NAME:TAG .
Start a new container docker run -d --name NAME -p 8080:80 IMAGE
Restart an existing container docker start CONTAINER
Follow logs docker logs -f CONTAINER
Open a shell docker exec -it CONTAINER sh
Create persistent storage docker volume create DATA
Join a named network docker run -d --network APP-NET --name APP IMAGE
Start a Compose app in background docker compose up -d
Run a one-off Compose task docker compose run --rm SERVICE COMMAND
Remove a Compose application docker compose down
Remove Compose volumes too docker compose down -v

Use docker compose down -v only when you intentionally want the Compose-managed volumes removed along with the application. For routine shutdown, plain down is the safer choice.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.