关灯
开启左侧

[Windows主机] Docker Light-weight virtualization - for class1

[复制链接]
云V小编 发表于 2022-4-8 10:02:19 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
 
Docker[1]  is a tool designed to make it easier to create, deploy, and run applications by using containers.
In this class , i will introduce the Virtual Maching used in Docker Class.
How to install the docker ?
c.f  Search "docker ce install centos7 "on google.com
centos 7 install docker
**You can use this command to verify that your virtual machine has docker installed rpm -qa | grep docker
In this docker VM needed two network adapter, (1) NAT (2) Host-only
How to start the docker service ?systemctl start docker
How to check the docker service?
systemctl status docker
**For this First Class**we need to pull the docker image from docker hub after started the docker service in this VM, and change the user to root
docker pull chusiang/takaojs1607
this command could need some time to get the docker images from the internet .
After when you fininshed , you can use this command to check the docker images in your VM
docker images
in this command , you can see the Repository (Let's use this example)
(1)chusiang means the docker account
(2)takaojs1607 means the image name
And you can see that the IMAGED ID  like 90ebc6376878
IMAGED ID can be only , and the containers ID can be many different.*Let start docker !
docker run -it chusiang/takojs1607 bash
-i  means interactive
-t means terminal
bash ---> command
the basic command for first Class
docker ps
it can check what the docker process run on this system
ex: the container id is f0eba9cc4a7`docker stop containers ID
ex: docker stop f0edocker ps -a
-a meanes all , you can see all the docker processdocker start containers ID
ex: docker start f0edocker attach containers ID
ex: docker attach f0edocker rm containers ID
you can use this command to remove this container !
But !! not the docker images !docker rm -f $(docker ps -q -a)this command can kill the docker container by force whatever the docker process start or stop
-f means  force
-a means all
Reference
 
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则


0关注

0粉丝

101帖子

热门图文
热门帖子
排行榜
作者专栏

关注我们:微信订阅号

官方微信

APP下载

全国服务Q Q:

956130084

中国·湖北

Email:956130084@qq.com

Copyright   ©2015-2022  站长技术交流论坛|互联网技术交流平台Powered by©Discuz!技术支持:得知网络  

鄂公网安备 42018502006730号

  ( 鄂ICP备15006301号-5 )