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

相关内容

热门资讯

原创 手... 以前购买的手机想要用3天不充电,基本上是不可能的,但这两年手机电池技术有大突破,非重度使用的情况下,...
咪咕数媒亮相第34届全国图书交... 潮新闻客户端 记者 王景平 7月24日,第34届全国图书交易博览会盛大举办。作为数字文化领域的核心央...
王兴兴和他的机甲机器人登上《时... 当地时间7月23日,宇树科技创始人兼首席执行官王兴兴与该公司突破性的载人机甲机器人GD01共同登上美...
APEC论坛聚焦亚太人工智能普... 这是7月23日在成都街头拍摄的会议主题装置。当日,2026年亚太经合组织(APEC)数字和人工智能部...
菲尔兹奖得主王虹4岁不慎烫伤,... 中国数学家王虹、邓煜获得菲尔兹奖,这是中国籍数学家首次获得这一奖项。王虹1991年出生在广西桂林平乐...
美媒:特朗普下令暂停空袭伊朗 美国“Axios”新闻网7月25日援引知情人士报道,特朗普24日指示美军不得对伊朗发动新的打击,打破...
法国野火“创历史纪录”:政坛吵... 综合法媒BFM新闻台、《费加罗报》报道,当地时间7月25日中午,内政部长努内兹(Laurent Nu...
51.79亿,携程真的疼了吗? 2026年7月25日,市场监管总局对携程反垄断案作出行政处罚:罚没款合计51.79亿元。但这个数字被...
一艘越南籍渔船在南沙遇险,29... 新华社三沙7月25日电(记者赵颖全)记者从三沙海上搜救中心获悉,25日傍晚,一艘越南籍渔船在南沙永暑...
成都如何耕好新型工业化“试验田... 7月24日,APEC数字周城市侧配套活动——制造强国建设专家研讨暨新型工业化推进交流会举行,院士专家...