溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Docker Light-weight virtualization - for class1

發(fā)布時間:2020-07-18 11:20:43 來源:網(wǎng)絡(luò) 閱讀:321 作者:gyrgey18912 欄目:系統(tǒng)運(yùn)維

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

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI