参考:
uname -a
// Linux dlserver 4.15.0-33-generic #36~16.04.1-Ubuntu SMP Wed Aug 15 17:21:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linuxsudo grep device-mapper /proc/devices
或者使用: ls -l /sys/class/misc/device-mapper
// 253 device-mappersudo apt-get install -y apt-transport-https ca-certificates curl software-properties-commonsudo apt-get remove docker docker-engine docker-ce docker.iosudo apt-get install docker.io
source/etc/bash_ completion.d/docker.ioapt-get update
apt-get install -y apt-transport-https ##检查APT的HTPS支持查看/usT/ib/apt/methods/htps文件是否存在,如果不存在,运行安装命令
echo deb htps://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list
##添加仓库key
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
##安装
apt-get update
apt-get install -y lxc-dockersudo apt-get install -y curl #安装curl(Ubuntu默认没安装curl)
curl -sSL https://get.docker.com/ubuntu/ | sudo shcurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"sudo apt-get updateapt-cache madison docker-cecurl -sSL https://get.daocloud.io/docker | shsudo apt-get updatesudo apt-get install -y docker-ce=版本号sudo apt-get install -y docker-ce
或者
sudo apt-get install -y docker.iodocker info输出
Client:
Debug Mode: false
Server:
Containers: 4
Running: 0
Paused: 0
Stopped: 4
Images: 9
Server Version: 19.03.2
Storage Driver: overlay
Backing Filesystem: extfs
Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.4.0-116-generic
Operating System: Ubuntu 16.04.4 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.953GiB
Name: ubuntu
ID: OXMT:BOKA:XD3R:J4LU:PTIC:USC5:2EKK:LUWZ:DEHH:337U:2XA2:2NJC
Docker Root Dir: /data
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Registry Mirrors:
http://f1361db2.m.daocloud.io/
https://docker.mirrors.ustc.edu.cn/
Live Restore Enabled: false
WARNING: No swap limit support
WARNING: the overlay storage-driver is deprecated, and will be removed in a future release.sudo service docker stopcd /etc/systemd/system/docker.service.d
如果没有docker.service.d 则创建这个路径:
cd /etc/systemd/system/
mkdir docker.service.dsudo vim docker-overlay.conf
如果没有则创建这个文件 touch docker-overlay.confinsert按钮,将内容设置好之后,点击esc按钮,输入:wq进行保存[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --graph="新的存储路径" --storage-driver=overlaysystemctl daemon-reload
sudo service docker startsudo docker info
若是没有成功,在下面添加一行 EnvironmentFile=-/etc/default/docker
然后运行
systemctl unmask docker.service
systemctl unmask docker.socket
systemctl start docker.service
重启docker试试cd /etc/systemd/system/docker.service.d
sudo vim docker-overlay.conf配置
添加一行:
EnvironmentFile=-/etc/default/docker进入https://dashboard.daocloud.io/build-flows
点击加速图标,获取并运行linux中的
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io本地设置
vim /etc/default/docker
添加一行
DOCKER_OPTS=" --registry-mirror=http://f1361db2.m.daocloud.io "
保存,刷新文件
systemctl daemon-reload
sudo service docker restart使用docker info查看信息
默认情况下,docker必须要root用户才能操作
sudo groupadd docker ##添加名为docker的用户
sudo gpasswd -a ${用户} docker ##若是docker存在,添加用户 例如sudo gpasswd -a jkxy docker
sudo service docker restart ##重启docker服务
然后需要重启Ubuntu环境all in one installers for os x and WindowsWindows 连接原文:https://www.cnblogs.com/ziyue7575/p/9fdad2bd1d8801c07adafe47a7ec5454.html