Docker : Install2019/07/24 |
Install Docker which is the Operating System-Level Virtualization Tool, which automates the deployment of applications inside Containers.
|
|
[1] | Install Docker. |
root@dlp:~# apt -y install docker.io
|
[2] | Download an official image and create a Container and output the words [Welcome to the Docker World] inside the Container. |
# download the image root@dlp:~# docker pull debian
Using default tag: latest latest: Pulling from library/debian 5ae19949497e: Pull complete Digest: sha256:903779f30a7ee46937bfb21406f125d5fdace4178074e1cc71c49039ebf7f48f Status: Downloaded newer image for debian:latest # run echo inside Container root@dlp:~# docker run debian /bin/echo "Welcome to the Docker World!" Welcome to the Docker World! |
[3] | Connect to the interactive session of a Container with [i] and [t] option like follows. If exit from the Container session, the process of a Container finishes. |
root@dlp:~# docker run -it debian /bin/bash root@7f48eb4b9db4:/# # Container's console root@7f48eb4b9db4:/# uname -a Linux 7f48eb4b9db4 4.19.0-5-amd64 #1 SMP Debian 4.19.37-5 (2019-06-19) x86_64 GNU/Linux root@7f48eb4b9db4:/# exit exit root@dlp:~# # come back
|
[4] | If exit from the Container session with keeping container's process, push [Ctrl+p] and [Ctrl+q] key. |
root@dlp:~#
docker run -it debian /bin/bash root@155deb48bfb8:/# root@dlp:~# # Ctrl+p, Ctrl+q
# show docker process root@dlp:~# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 155deb48bfb8 debian "/bin/bash" 16 seconds ago Up 14 seconds agitated_albattani # connect to container's session root@dlp:~# docker attach 155deb48bfb8 root@155deb48bfb8:/# # shutdown container's process from Host's console root@dlp:~# docker kill 155deb48bfb8 155deb48bfb8 root@dlp:~# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
Sponsored Link |