Docker Basic

Contents

Some notes about using docker

Manipulate Container

1
docker run <image name>
This is a tip
=
+
docker run
docker create
docker start

docker start -a (watch for the output of the container and put it to terminal)

1
docker run <image name>  <command>
1
docker ps --all
1
docker system prune
1
docker logs <container id>
1
2
docker stop <container id>
docker kill <container id>
This is a tip
docker stop will allow the process to clean up while the docker kill will terminate the process immediately
1
docker exec -it <container id> <command>
This is a tip
-i flag direct the stdin and stdout -t format the stdin and stdout
This is a tip
docker exec -it <container id> sh get command prompt
This is a tip

alternatively,

1
docker run -it <image id> <command>

Start the container and run the command

No comment yet.
Powered By Valine
v1.4.14