Безкоштовний конвертер

Команди Docker Шпаргалка

Комплексна шпаргалка команд Docker. Шукайте понад 70 основних команд Docker із прикладами, описами та копією одним клацанням миші.

docker run
Create and start a new container from an image
приклад:docker run -d -p 80:80 --name web nginx
docker run -it
Run a container interactively with a terminal
приклад:docker run -it ubuntu bash
docker run --rm
Run a container and remove it automatically when it exits
приклад:docker run --rm alpine echo 'hello'
docker run -e
Set environment variables in a container
приклад:docker run -e NODE_ENV=production node:18
docker run -v
Mount a volume or bind mount into a container
приклад:docker run -v /host/path:/container/path nginx
docker start
Start one or more stopped containers
приклад:docker start my-container
docker stop
Stop one or more running containers gracefully
приклад:docker stop my-container
docker restart
Restart one or more containers
приклад:docker restart my-container
docker rm
Remove one or more stopped containers
приклад:docker rm my-container
docker rm -f
Force-remove a running container
приклад:docker rm -f my-container
docker ps
List running containers
приклад:docker ps
docker ps -a
List all containers including stopped ones
приклад:docker ps -a
docker exec
Run a command in a running container
приклад:docker exec -it my-container bash
docker logs
Fetch logs from a container
приклад:docker logs -f --tail 100 my-container
docker inspect
Return low-level information about a container or image
приклад:docker inspect my-container
docker stats
Display live resource usage statistics for containers
приклад:docker stats my-container
docker top
Display running processes inside a container
приклад:docker top my-container
docker pause
Pause all processes within a container
приклад:docker pause my-container
docker unpause
Unpause all processes within a paused container
приклад:docker unpause my-container
docker rename
Rename an existing container
приклад:docker rename old-name new-name
docker kill
Kill a running container by sending a signal
приклад:docker kill --signal=SIGTERM my-container
docker cp
Copy files between a container and the host filesystem
приклад:docker cp my-container:/app/config.json ./config.json
docker attach
Attach local I/O streams to a running container
приклад:docker attach my-container
docker pull
Download an image from a registry
приклад:docker pull nginx:latest
docker push
Upload an image to a registry
приклад:docker push myuser/myimage:v1.0
docker build
Build an image from a Dockerfile
приклад:docker build -t myapp:latest .
docker build --no-cache
Build an image without using the layer cache
приклад:docker build --no-cache -t myapp:latest .
docker images
List all locally available images
приклад:docker images
docker rmi
Remove one or more images
приклад:docker rmi nginx:old myimage:v1
docker tag
Create a tag referencing a source image
приклад:docker tag myapp:latest myuser/myapp:v2.0
docker history
Show the history of an image's layers
приклад:docker history nginx:latest
docker save
Save an image to a tar archive
приклад:docker save -o myimage.tar myapp:latest
docker load
Load an image from a tar archive
приклад:docker load -i myimage.tar
docker import
Import a tarball to create a filesystem image
приклад:docker import mycontainer.tar myimage:imported
docker export
Export a container's filesystem as a tar archive
приклад:docker export my-container > mycontainer.tar
docker commit
Create a new image from a container's changes
приклад:docker commit my-container myimage:snapshot
docker image prune
Remove unused (dangling) images
приклад:docker image prune -a
docker network create
Create a new network
приклад:docker network create --driver bridge my-network
docker network ls
List all networks
приклад:docker network ls
docker network rm
Remove one or more networks
приклад:docker network rm my-network
docker network inspect
Show detailed information about a network
приклад:docker network inspect my-network
docker network connect
Connect a running container to a network
приклад:docker network connect my-network my-container
docker network disconnect
Disconnect a container from a network
приклад:docker network disconnect my-network my-container
docker network prune
Remove all unused networks
приклад:docker network prune
docker volume create
Create a named volume
приклад:docker volume create my-volume
docker volume ls
List all volumes
приклад:docker volume ls
docker volume rm
Remove one or more volumes
приклад:docker volume rm my-volume
docker volume inspect
Display detailed information about a volume
приклад:docker volume inspect my-volume
docker volume prune
Remove all unused local volumes
приклад:docker volume prune
docker compose up
Create and start all services defined in compose file
приклад:docker compose up -d
docker compose down
Stop and remove containers, networks from compose
приклад:docker compose down --volumes
docker compose ps
List containers for a compose project
приклад:docker compose ps
docker compose logs
View output from compose service containers
приклад:docker compose logs -f web
docker compose build
Build or rebuild services defined in compose file
приклад:docker compose build --no-cache web
docker compose pull
Pull service images defined in the compose file
приклад:docker compose pull
docker compose restart
Restart service containers
приклад:docker compose restart web
docker compose exec
Execute a command in a running service container
приклад:docker compose exec web bash
docker compose run
Run a one-off command on a service
приклад:docker compose run --rm web npm test
docker compose stop
Stop running containers without removing them
приклад:docker compose stop web
docker compose config
Validate and view the merged compose configuration
приклад:docker compose config
docker info
Display system-wide Docker information
приклад:docker info
docker version
Show the Docker client and daemon version
приклад:docker version
docker system df
Show disk usage by Docker objects
приклад:docker system df -v
docker system prune
Remove all unused Docker resources at once
приклад:docker system prune -a --volumes
docker events
Stream real-time events from the Docker daemon
приклад:docker events --filter type=container
docker login
Log in to a Docker registry
приклад:docker login registry.example.com
docker logout
Log out from a Docker registry
приклад:docker logout registry.example.com
docker search
Search Docker Hub for images
приклад:docker search --filter stars=100 nginx
docker context ls
List available Docker contexts
приклад:docker context ls
docker context use
Switch the active Docker context
приклад:docker context use my-remote-host

Про цей інструмент

Вичерпний короткий довідник для команд докера. Перегляньте типові команди, синтаксис і приклади, упорядковані за категоріями. Доступна для пошуку та зручна для мобільних пристроїв — додайте цю сторінку в закладки для миттєвого доступу, коли вам знадобиться швидке нагадування.

Як використовувати

  1. Перегляньте категорізовані довідкові розділи.
  2. Використовуйте панель пошуку, щоб знайти певні команди або синтаксис.
  3. Натисніть будь-який запис, щоб переглянути приклади використання та пояснення.
  4. Копіюйте команди безпосередньо для використання в терміналі або редакторі.

Поширені запитання

Це посилання актуальне?
Довідник охоплює широко використовувані команди та синтаксис, які є стабільними в усіх версіях. Для отримання найновіших доповнень або функцій, що стосуються певної версії, перегляньте офіційну документацію.
Чи можу я використовувати це офлайн?
Після завантаження сторінка працює без підключення до Інтернету. Додайте його в закладки для швидкого доступу — весь вміст відображається в браузері без подальших мережевих запитів.
Це всебічно чи лише основи?
Він охоплює найбільш часто використовувані команди та шаблони, які виконують 90% повсякденних завдань. Щоб дізнатися про спеціальну або розширену функцію, зверніться до офіційної документації.
Чи можу я запропонувати доповнення?
Ми регулярно оновлюємо наші посилання. Якщо ви помітили відсутні команди або маєте пропозиції, повідомте нам про це через нашу сторінку контактів.