Wednesday, 10 July 2019

10 Docker Command Part-4 By Raj Gupta

1. This will kill the running container

[root@ip-172-31-38-174 ~]# docker container kill dd8442fd1087

2. This command will wait until container will stop and when container stop it will return stop id(0)

[root@ip-172-31-38-174 ~]# docker container wait b5e091c626b3

3. This will pause all the process running in the container and you are not able to access it

[root@ip-172-31-38-174 ~]# docker container pause b5e091c626b3

4. This will unpause the pause container

[root@ip-172-31-38-174 ~]# docker container unpause b5e091c626b3

5. It will delete all the non-running container

[root@ip-172-31-38-174 ~]# docker container prune

6. This will give port mapping details

[root@ip-172-31-38-174 ~]# docker container port b5e091c626b3       

7. This will create container but not run it but run command create and run container

[root@ip-172-31-38-174 ~]# docker container create ubuntu sleep 60

8. This will start the created container

[root@ip-172-31-38-174 ~]# docker container start 3cd4449cbb68

9. This will give the difference between container with last update in container

[root@ip-172-31-38-174 ~]# docker container diff b5e091c626b3

10. This will copy file a.txt to container from local host

[root@ip-172-31-38-174 ~]# docker container cp a.txt 1982459689ef:/tmp  

1 comment: