Docker : Install2019/01/22 |
Install Docker which is the Operating System-Level Virtualization Tool, which automates the deployment of applications inside Containers.
|
|
[1] | Install Docker. |
# add extension module first dlp:~ # SUSEConnect -p sle-module-containers/15/x86_64
dlp:~ #
dlp:~ # zypper -n install docker
systemctl start docker dlp:~ # systemctl enable docker |
[2] | Download an official image and create a Container and output the words [Welcome to the Docker World] inside the Container. |
# download official image dlp:~ # docker pull fedora Using default tag: latest Trying to pull repository docker.io/library/fedora ... ..... ..... # run echo inside Container dlp:~ # docker run fedora /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. |
dlp:~ #
[root@5d7232bed21f /]# docker run -i -t fedora /bin/bash [root@5d7232bed21f /]# # connected
uname -a Linux 5d7232bed21f 4.12.14-25.25-default #1 SMP Thu Oct 25 16:07:27 UTC 2018 (d2d8b17) x86_64 x86_64 x86_64 GNU/Linux [root@5d7232bed21f /]# exit exit dlp:~ # # come back
|
[4] | If exit from the Container session with keeping container's process, push [Ctrl + p] and [Ctrl + q] key. |
dlp:~ #
docker run -i -t fedora /bin/bash [root@07a6aed99d97 /]# dlp:~ # # Ctrl+p, Ctrl+q
# show docker process dlp:~ # docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 07a6aed99d97 fedora "/bin/bash" 27 seconds ago Up 26 seconds affectionate_rosalind # connect to container's session dlp:~ # docker exec -it 07a6aed99d97 /bin/bash [root@07a6aed99d97 /]# # connected
# shutdown container's process from Host's console dlp:~ # docker kill 07a6aed99d97 07a6aed99d97 dlp:~ # docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
Sponsored Link |
|