docker commands, flags, syntax Flashcards
-d
detach
-p
port
docker exec -it image_id ps -aux
full process listing of anything inside container
full process listing of anything inside container
docker exec -it image_id ps -aux
run shell inside docker container and connect to shell
docker exec -it image_id sh
docker exec -it image_id sh
run shell inside docker container and connect to shell
restart container
docker restart image_id
get logging info for container
docker logs image_id
get timestamped logs of container
docker logs image_id -t
remove a stopped container
docker rm <CONTAINER ID/CONTAINER NAME>
get further information about an image or a container.
docker inspect <CONTAINER ID/NAME OR IMAGE ID/NAME>
Create a volume with the volume name (used to persist data in a container beyond its lifecycle)
docker volume create <VOLUMENAME></VOLUMENAME>
List all volumes
docker volume ls
Use a docker compose file (compose.yaml) to run multi-container applications.
docker compose up -d
Stop and remove all the containers contained in the docker compose file (compose.yaml).
docker compose down