User Tools

Site Tools


virtualization:docker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
virtualization:docker [2022/02/28 17:19] – external edit 127.0.0.1virtualization:docker [2023/11/02 14:38] (current) – external edit 127.0.0.1
Line 6: Line 6:
  
 Tutorial, all [[https://container.training/intro-fullday.yml.html#65|HERE]]\\ Tutorial, all [[https://container.training/intro-fullday.yml.html#65|HERE]]\\
-The principle of docker is we start a container to __Run a Task__. If there's no task to run, the container just __stops and exists__.\\+The principle of docker is we start a container to __Run a Task__. If there's no task to run, the container just __stops and exits__.\\
  
  
Line 25: Line 25:
   docker stop f51e9de57784     # list containers with ps -a   docker stop f51e9de57784     # list containers with ps -a
   docker restart <container-id/name>   # restart   docker restart <container-id/name>   # restart
 +  docker run -itd --name c3 busybox    # start container daemon mode
 +  docker run -it --name c2 busybox    # start container interactive mode
   docker exec -it "id of running container" bash # connect running container   docker exec -it "id of running container" bash # connect running container
      
 +Remove all running and exited container (USER WITH CARE!):
 +  docker container kill $(docker ps -q)
 +  docker rm $(docker ps -a -f status=exited -q)
 +
 To list containers, stop them , get logs etc,[[https://www.docker.com/sites/default/files/Docker_CheatSheet_08.09.2016_0.pdf|**check this link**]] To list containers, stop them , get logs etc,[[https://www.docker.com/sites/default/files/Docker_CheatSheet_08.09.2016_0.pdf|**check this link**]]
      
virtualization/docker.1646068761.txt.gz · Last modified: (external edit)