Ilmainen muunnin

Dockerin komennot Huijauslehti

Kattava Docker-komentohuijauslehti. Hae yli 70 tärkeästä Docker-komennosta esimerkeillä, kuvauksilla ja yhdellä napsautuksella.

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

Tietoa tästä työkalusta

Kattava pikaopas telakointikomentoihin. Selaa yleisesti käytettyjä komentoja, syntaksia ja esimerkkejä luokittain järjestettyinä. Hakukelpoinen ja mobiiliystävällinen – merkitse tämä sivu kirjanmerkkeihin, jotta pääset heti, kun tarvitset nopean muistutuksen.

Käyttöohjeet

  1. Selaa luokiteltuja viiteosioita.
  2. Käytä hakupalkkia löytääksesi tiettyjä komentoja tai syntaksia.
  3. Napsauta mitä tahansa kohtaa nähdäksesi käyttöesimerkkejä ja selityksiä.
  4. Kopioi komennot suoraan käytettäväksi päätteessäsi tai editorissasi.

Usein kysytyt kysymykset

Onko tämä viittaus ajan tasalla?
Viite kattaa laajalti käytetyt komennot ja syntaksin, jotka ovat vakaat eri versioissa. Katso uusimmat lisäykset tai versiokohtaiset ominaisuudet virallisesta dokumentaatiosta.
Voinko käyttää tätä offline-tilassa?
Kun sivu on ladattu, se toimii ilman Internet-yhteyttä. Lisää se kirjanmerkkeihin nopeaa käyttöä varten – kaikki sisältö hahmonnetaan selaimessa ilman muita verkkopyyntöjä.
Onko tämä kattava vai vain perusasiat?
Se kattaa yleisimmin käytetyt komennot ja mallit, jotka käsittelevät 90 % jokapäiväisistä tehtävistä. Katso niche- tai lisäominaisuudet virallisesta dokumentaatiosta.
Voinko ehdottaa lisäyksiä?
Päivitämme referenssejämme säännöllisesti. Jos huomaat puuttuvia komentoja tai sinulla on ehdotuksia, kerro siitä meille yhteystietosivumme kautta.