Base de connaissances

Essential Docker Commands Cheat Sheet

A quick reference to the Docker commands you’ll use most often.

Images

docker pull nginx          # download an image
docker images              # list local images
docker rmi nginx           # remove an image
docker build -t myapp .     # build from a Dockerfile

Containers

docker run -d -p 80:80 --name web nginx   # run detached
docker ps                 # running containers
docker ps -a              # all containers
docker stop web           # stop
docker start web          # start
docker rm web             # remove

Inspecting and debugging

docker logs -f web        # follow logs
docker exec -it web bash  # shell into a container
docker inspect web        # detailed info

Cleanup

docker system prune -a    # remove unused images/containers

Combine with Docker Compose for multi-container apps.

Cette réponse était-elle pertinente?

0 Utilisateurs l'ont trouvée utile

Powered by WHMCompleteSolution