Client and server versions
Viewdocker version
COMMANDS
Build an image, run a container, inspect a problem, and clean up specific resources.
53 commands
docker version
docker info
A daemon connection error means the engine is unavailable or inaccessible.
docker context ls
docker system df
docker build -t APP:local .
Uses the current build context and its Dockerfile. Build instructions execute during the build.
docker image ls
docker image inspect APP:local
docker image inspect APP:local --format "{{.Config.User}}"An empty value means the image did not specify a user; it does not establish the effective UID in every run.
docker run --rm --name APP -p 127.0.0.1:3000:3000 IMAGE
Foreground run. --rm removes the container after it exits; it does not remove named volumes.
docker ps
docker ps -a
docker logs --tail 100 --follow CONTAINER
Streams stdout/stderr available through the logging driver. Ctrl+C stops following, not the container.
docker inspect CONTAINER
docker inspect CONTAINER --format "{{if .State.Health}}{{.State.Health.Status}}{{else}}no healthcheck{{end}}"docker exec -it CONTAINER sh
Runs a process inside the container. sh may not exist in minimal images; commands you run can change container data.
docker compose config --quiet
Validates the configuration without printing its resolved values.
docker compose up -d
Creates or updates the project and runs services in the background.
docker compose ps
docker stop CONTAINER
Sends the configured stop signal, then may force termination after the timeout. A --rm container is removed on exit.
docker rm CONTAINER
Removes the container and its writable layer. Does not remove named volumes.
docker compose down
Removes project containers and networks; named volumes remain without --volumes.
docker stats --no-stream CONTAINER
docker top CONTAINER
docker diff CONTAINER
Shows added, changed, and deleted paths relative to the image.
docker logs --timestamps --tail 100 CONTAINER
docker wait CONTAINER
Blocks and prints its exit code.
docker cp CONTAINER:/PATH/FILE ./FILE
Copies to your computer and may overwrite the destination.
docker inspect CONTAINER --format '{{index .Config.Labels "KEY"}}'docker ps -a --filter label=KEY=VALUE
docker port CONTAINER
docker run --rm --user 65534:65534 IMAGE COMMAND
The command must have permission to access its required files.
docker run --rm --read-only --tmpfs /tmp:rw,noexec,nosuid,mode=1777 IMAGE
Application writes must use writable mounts.
docker run --rm --cap-drop ALL --security-opt no-new-privileges IMAGE
Test application compatibility.
docker run --rm --memory 64m --cpus 0.5 --pids-limit 32 IMAGE
Limits require engine support and do not reserve these resources.
docker run --rm --network none IMAGE COMMAND
Only its loopback interface is available.
docker volume create VOLUME
Existing names refer to existing data; choose deliberately.
docker volume ls
docker volume inspect VOLUME
docker run --rm --mount type=volume,source=VOLUME,target=/data IMAGE
Application permissions must match the mount.
docker volume rm VOLUME
Permanently removes that volume’s data; do not use it for unrelated work.
docker network create --internal NETWORK
Creates a user-defined network isolated from external connectivity.
docker network ls
docker network inspect NETWORK
docker network connect NETWORK CONTAINER
Changes that container’s connectivity.
docker network rm NETWORK
Connected endpoints must be detached first.
docker image history IMAGE
docker image tag SOURCE_IMAGE TARGET_IMAGE
Does not copy layers or upload anything.
docker image save -o image.tar IMAGE
Writes an archive on your computer.
docker image load -i image.tar
Adds the archive’s images locally; does not run them.
docker compose config --services
docker compose logs --tail 100 -f SERVICE
docker compose run --rm SERVICE COMMAND
Creates a new container and can change mounted data.
docker compose stop
Use compose start to start the same containers again.
No match. Try another command, task, or turn off the changes filter.