1. 程式人生 > >使用docker二進位制檔案安裝

使用docker二進位制檔案安裝

1,下載 https://download.docker.com/linux/static/stable/x86_64/docker-18.03.1-ce.tgz

2,解壓, tar xzvf docker-18.03.1-ce.tgz

3,複製二進位制檔案到/usr/bin目錄下

cp docker/* /usr/bin/

4,檢查是否安裝

docker version

    
  1. Client:
  2.  Version:      18.03.1-ce
  3.  API version:  1.37
  4.  Go version:   go1.9.2
  5.  Git commit:    9
    ee9f40
  6.  Built:        Thu Apr 26 07: 12: 25 2018
  7.  OS/Arch:      linux/amd64
  8.  Experimental: false
  9.  Orchestrator: swarm
  10. Server:
  11.   Engine:
  12.   Version:      18.03 .1-ce
  13.   API version1.37 ( minimum version 1.12)
  14.   Go version:   go1 .9 .5
  15.   Git commit:    9ee9f40
  16.   Built:        Thu Apr 26 07: 23: 03 2018
  17.   OS/Arch:      linux/amd64
  18.   Experimental: false


5,配置 docker.service檔案

vi /usr/lib/systemd/system/docker.service


    
  1. [ Unit]
  2. Description=Docker Application Container Engine
  3. Documentation=https: //docs.docker.com
  4. After=network-online.target firewalld.service
  5. Wants=network-online.target
  6. [ Service]
  7. Type=notify
  8. ExecStart=/usr/bin/dockerd
  9. ExecReload=/bin/kill -s HUP $MAINPID
  10. LimitNOFILE=infinity
  11. LimitNPROC=infinity
  12. TimeoutStartSec= 0
  13. Delegate=yes
  14. KillMode=process
  15. Restart= on-failure
  16. StartLimitBurst= 3
  17. StartLimitInterval= 60s
  18. [ Install]
  19. WantedBy=multi-user.target

6,啟動dockerd服務程序


    
  1. systemctl daemon-reload
  2. systemctl start docker .service

7,檢驗


    
  1. # ps aux|grep docker
  2. root 2262 0.1 4.4 472948 44944 ? Ssl 16: 38 0: 00 /usr/bin/dockerd
  3. root 2266 0.2 1.3 277032 13540 ? Ssl 16: 38 0: 01 docker-containerd --config / var/run/docker/containerd/containerd.toml
  4. root 2895 0.0 0.0 112660 972 pts/ 0 S+ 16: 48 0: 00 grep --color=auto docker

    
  1. # docker run hello-world
  2. Hello from Docker!
  3. This message shows that your installation appears to be working correctly.
  4. To generate this message, Docker took the following steps:
  5. 1. The Docker client contacted the Docker daemon.
  6. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
  7. (amd64)
  8. 3. The Docker daemon created a new container from that image which runs the
  9. executable that produces the output you are currently reading.
  10. 4. The Docker daemon streamed that output to the Docker client, which sent it
  11. to your terminal.
  12. To try something more ambitious, you can run an Ubuntu container with:
  13. $ docker run -it ubuntu bash
  14. Share images, automate workflows, and more with a free Docker ID:
  15. https://hub.docker.com/
  16. For more examples and ideas, visit:
  17. https://docs.docker.com/engine/userguide/


1,下載 https://download.docker.com/linux/static/stable/x86_64/docker-18.03.1-ce.tgz

2,解壓, tar xzvf docker-18.03.1-ce.tgz

3,複製二進位制檔案到/usr/bin目錄下

cp docker/* /usr/bin/

4,檢查是否安裝

docker version

  
  1. Client:
  2.  Version:      18.03.1-ce
  3.  API version:  1.37
  4.  Go version:   go1.9.2
  5.  Git commit:    9ee9f40
  6.  Built:        Thu Apr 26 07: 12: 25 2018
  7.  OS/Arch:      linux/amd64
  8.  Experimental: false
  9.  Orchestrator: swarm
  10. Server:
  11.   Engine:
  12.   Version:      18.03 .1-ce
  13.   API version1.37 ( minimum version 1.12)
  14.   Go version:   go1 .9 .5
  15.   Git commit:    9ee9f40
  16.   Built:        Thu Apr 26 07: 23: 03 2018
  17.   OS/Arch:      linux/amd64
  18.   Experimental: false


5,配置 docker.service檔案

vi /usr/lib/systemd/system/docker.service


  
  1. [ Unit]
  2. Description=Docker Application Container Engine
  3. Documentation=https: //docs.docker.com
  4. After=network-online.target firewalld.service
  5. Wants=network-online.target
  6. [ Service]
  7. Type=notify
  8. ExecStart=/usr/bin/dockerd
  9. ExecReload=/bin/kill -s HUP $MAINPID
  10. LimitNOFILE=infinity
  11. LimitNPROC=infinity
  12. TimeoutStartSec= 0
  13. Delegate=yes
  14. KillMode=process
  15. Restart= on-failure
  16. StartLimitBurst= 3
  17. StartLimitInterval= 60s
  18. [ Install]
  19. WantedBy=multi-user.target

6,啟動dockerd服務程序


  
  1. systemctl daemon-reload
  2. systemctl start docker .service

7,檢驗


  
  1. # ps aux|grep docker
  2. root 2262 0.1 4.4 472948 44944 ? Ssl 16: 38 0: 00 /usr/bin/dockerd
  3. root 2266 0.2 1.3 277032 13540 ? Ssl 16: 38 0: 01 docker-containerd --config / var/run/docker/containerd/containerd.toml
  4. root 2895 0.0 0.0 112660 972 pts/ 0 S+ 16: 48 0: 00 grep --color=auto docker

  
  1. # docker run hello-world
  2. Hello from Docker!
  3. This message shows that your installation appears to be working correctly.
  4. To generate this message, Docker took the following steps:
  5. 1. The Docker client contacted the Docker daemon.
  6. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
  7. (amd64)
  8. 3. The Docker daemon created a new container from that image which runs the
  9. executable that produces the output you are currently reading.
  10. 4. The Docker daemon streamed that output to the Docker client, which sent it
  11. to your terminal.
  12. To try something more ambitious, you can run an Ubuntu container with:
  13. $ docker run -it ubuntu bash
  14. Share images, automate workflows, and more with a free Docker ID:
  15. https://hub.docker.com/
  16. For more examples and ideas, visit:
  17. https://docs.docker.com/engine/userguide/