Docker 内网环境安装指南

  • 查看操作系统信息,后面在下载对应的docker安装程序包时需要用到 使用命令lsb_release -a,注意查看Codename信息
No LSB modules are available.  
Distributor ID: Ubuntu  
Description:    Ubuntu 16.04.2 LTS  
Release:        16.04  
Codename:       xenial --- 下载docker安装包  
Hello from Docker!  
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:  
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:  
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:  
 https://hub.docker.com/

For more examples and ideas, visit:  
 https://docs.docker.com/engine/userguide/

4.配置私有镜像仓库地址
修改 /etc/docker/daemon.json文件

{
    "registry-mirrors": ["https://XXXX.com","docker-hub.tools.soft256.com"],
    //取消安全认证?
    "insecure-registries" : ["docker-hub.tools.soft256.com"]
}

5.使用docker info查看docker安装详情

Containers: 1  
 Running: 0
 Paused: 0
 Stopped: 1
Images: 1  
Server Version: 17.03.2-ce  
Storage Driver: aufs  
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 3
 Dirperm1 Supported: true
Logging Driver: json-file  
Cgroup Driver: cgroupfs  
Plugins:  
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive  
Runtimes: runc  
Default Runtime: runc  
Init Binary: docker-init  
containerd version: 4ab9917febca54791c5f071a9d1f404867857fcc  
runc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe  
init version: 949e6fa  
Security Options:  
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-62-generic  
Operating System: Ubuntu 16.04.2 LTS  
OSType: linux  
Architecture: x86_64  
CPUs: 4  
Total Memory: 7.774 GiB  
Name: SZV1000350469  
ID: 2UHF:R4YA:ACEX:PPLE:4RNI:LZGT:CNBD:WBXZ:HFMP:O7GH:YEAE:I6TU  
Docker Root Dir: /var/lib/docker  
Debug Mode (client): false  
Debug Mode (server): false  
Http Proxy: http://username:password@proxyhk.soft256.com:8080  
Https Proxy: http://username:password@proxyhk.soft256.com:8080  
No Proxy: localhost,127.0.0.1,docker-hub.tools.soft256.com,*.soft256.com  
Registry: https://index.docker.io/v1/  
Experimental: false  
Insecure Registries:  
 docker-hub.tools.soft256.com
 127.0.0.0/8
Registry Mirrors:  
 https://uo0hqeee.mirror.aliyuncs.com
 docker-hub.tools.soft256.com
Live Restore Enabled: false  

PS:启动失败时查看启动状态
systemctl status docker.service

参考文档地址 https://docs.docker.com/install/linux/docker-ce/centos/#upgrade-docker-ce-1
https://docs.docker.com/config/daemon/systemd/#httphttps-proxy

愚蠢的白羊

继续阅读此作者的更多文章