Konverter Gratis

Perintah Docker Lembar Contekan

Lembar contekan perintah Docker yang komprehensif. Cari 70+ perintah Docker penting dengan contoh, deskripsi, dan salin satu klik.

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

Tentang alat ini

Panduan referensi cepat yang komprehensif untuk perintah buruh pelabuhan. Telusuri perintah, sintaksis, dan contoh yang umum digunakan, disusun berdasarkan kategori. Dapat dicari dan ramah seluler — tandai halaman ini untuk akses cepat saat Anda memerlukan pengingat cepat.

Cara menggunakan

  1. Jelajahi bagian referensi yang dikategorikan.
  2. Gunakan bilah pencarian untuk menemukan perintah atau sintaksis tertentu.
  3. Klik entri mana pun untuk melihat contoh penggunaan dan penjelasannya.
  4. Salin perintah secara langsung untuk digunakan di terminal atau editor Anda.

Pertanyaan yang sering diajukan

Apakah referensi ini mutakhir?
Referensi ini mencakup perintah dan sintaksis yang banyak digunakan dan stabil di seluruh versi. Untuk tambahan terbaru atau fitur khusus versi, periksa dokumentasi resmi.
Bisakah saya menggunakan ini secara offline?
Setelah dimuat, halaman tersebut berfungsi tanpa koneksi internet. Tandai untuk akses cepat — semua konten ditampilkan di browser tanpa permintaan jaringan lebih lanjut.
Apakah ini komprehensif atau hanya dasar-dasarnya saja?
Ini mencakup perintah dan pola yang paling umum digunakan yang menangani 90% tugas sehari-hari. Untuk fitur khusus atau lanjutan, lihat dokumentasi resmi.
Bolehkah saya menyarankan tambahan?
Kami secara teratur memperbarui referensi kami. Jika Anda melihat ada perintah yang hilang atau memiliki saran, beri tahu kami melalui halaman kontak kami.