Docker Light-weight virtualization - for class1
admin
2023-03-08 16:22:13
0

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

  1. docker ps
    it can check what the docker process run on this system
    ex: the container id is f0eba9cc4a7
  2. `docker stop containers ID
    ex: docker stop f0e
  3. docker ps -a
    -a meanes all , you can see all the docker process
  4. docker start containers ID
    ex: docker start f0e
  5. docker attach containers ID
    ex: docker attach f0e
  6. docker rm containers ID
    you can use this command to remove this container !
    But !! not the docker images !
  7. 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
[1]https://www.docker.com

相关内容

热门资讯

特朗普的关键矿产战略能行吗? 5月7日,法国以G7轮值主席国身份召开线上高层会议,重点商讨在关键矿产领域对中国的遏制围堵政策。依托...
世卫组织:“洪迪厄斯”号邮轮疫... 世卫组织8日更新“洪迪厄斯”号邮轮疫情最新数据,截至5月8日,共报告8例病例,其中3例死亡病例。8例...
伊朗因储油罐已满而将石油排入海... 新华社德黑兰5月9日电 据伊朗塔斯尼姆通讯社9日凌晨报道,伊朗伊斯兰议会代表布什尔省的议员贾法尔·普...
金正恩向俄总统致贺电:平壤始终... 新华社平壤5月9日电(记者王天僚)据朝中社9日报道,朝鲜最高领导人金正恩当天向俄罗斯总统普京致贺电,...
美专家:伊朗扛不住了,或正向波... 据福克斯新闻5月8日报道,卫星图像显示,伊朗主要石油出口枢纽哈尔克岛附近出现大片疑似石油泄漏的浮油带...
黄土塬藏“算力密码”!中国电信... 在陇东黄土塬上,数字浪潮奔涌不息。作为国家 “东数西算” 工程的核心承载地,中国电信庆阳智算产业园正...
科沃斯加入清洁电器行业反虚假测... 【CNMO科技消息】5月8日,科沃斯官方微博宣布,科沃斯加入由中国家用电器协会指导、中国家电网发起成...
东华科技获得发明专利授权:“一... 证券之星消息,根据天眼查APP数据显示东华科技(002140)新获得一项发明专利授权,专利名为“一种...
头部企业扎堆超百场无人机赛事,... 文/陈聆听 2026 年 5 月 4 日,山东诸城,山东天鸟航空负责人丁总与当地多位中小学校长会面,...
重磅签约!华为、中国银联战略合... 快科技5月8日消息,华为和中国银联在深圳正式签约,进一步深化双方的战略合作,还一起发布了自主创新和人...