Linux下Docker安装配置
1.CentOS
服务器的系统是CentOS7.4的
[root@VM_82_178_centos ~]# cat /etc/RedHat-release
CentOS Linux release 7.4.1708 (Core)
#安装依赖包
yum install -y yum-utils device-mapper-persistent-data lvm2
#增加Docker软件包源
yum-config-manager \
–add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
#安装Docker CE
yum install docker-ce -y
#启动
systemctl start docker
#开机启动
systemctl enable docker
#查看Docker信息
docker info
2.Ubuntu 上安装
apt-get update
安装证书:
apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
增加docker源的key:
sudo apt-key fingerprint 0EBFCD88
pub 4096R/0EBFCD88 2017-02-22
Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid Docker Release (CE deb)
sub 4096R/F273FCD8 2017-02-22
增加docker软件包源:
sudo add-apt-repository \
“deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable”
跟新apt包索引:
sudo apt-get update
安装docker ce
apt-get install docker-ce
3.配置Docker加速器
Docker Hub 提供众多镜像,你可以从中自由下载数十万计的免费应使用镜像, 这些镜像作为 docker 生态圈的基石,是我们用和学习 docker 不可或者缺的资源。为理解决国内使用户用 Docker Hub 时遇到的稳固性及速度问题 DaoCloud 推出永久免费的新一代加速器服务。
Linux:
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://bc437cce.m.daocloud.io
[root@localhost ~]# curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://bc437cce.m.daocloud.io
docker version >= 1.12
{“registry-mirrors”: [“http://bc437cce.m.daocloud.io”]}
Success.
You need to restart docker to take effect: sudo systemctl restart docker
[root@localhost ~]#
[root@localhost ~]# systemctl restart docker
[root@localhost ~]# systemctl stop docker
[root@localhost ~]# ps -ef|grep docker
root 15185 3300 0 01:39 pts/1 00:00:00 grep –color=auto docker
[root@localhost ~]# systemctl start docker
[root@localhost ~]# ps -ef|grep docker
root 15191 1 2 01:39 ? 00:00:00 /usr/bin/dockerd
root 15198 15191 0 01:39 ? 00:00:00 docker-containerd –config /var/run/docker/containerd/containerd.toml
root 15325 3300 0 01:39 pts/1 00:00:00 grep –color=auto docker
[root@localhost ~]#
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是摆设,本站源码仅提供给会员学习使用!
7. 如遇到加密压缩包,请使用360解压,如遇到无法解压的请联系管理员
开心源码网 » Linux下Docker安装配置