docker images
Show local images.docker ps -a
show started and stopped containers.docker ps
List all only running docker containers.docker stop <containerId>
Stop a docker container.docker start <containerId>
Starts a docker container.- Pause and unpause with
docker pause
anddocker unpause
docker run
Runs a container. eg.docker run ubuntu
docker rm
Delete a contaner. eg.docker rm <containerId>
docker image ls
List downloaded docker images.
docker exec -it <mycontainer> bash
to exit run exit
-t
means tag which is mydockerimage
in the example below.
docker build -t mydockerimage .
docker run -p 4000:80 mydockerimage
Run a docker image on port 4000docker run -it ubuntu bash
this is not very useful but it shows you how to start and enter a container.docker run -id ubuntu
Run a container and don't make it stop.
docker cp <containerId>:/file/path/within/container/file.txt /host/path/target/file.txt
docker stats --all
shows a running list of containers.