centos7 安装docker_Docker安装(CentOs7)

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 20:33   4460   0

系统环境

CentOs7 (linux)

======================

1、更新系统

# yum -y update# yum -y install iptables-services# systemctl start iptables# systemctl enable iptables# iptables -F # iptables -nl# reboot

2、新建一个docker目录,把rpm传到docker目录下

# mkdir docker # cd docker# yum -y install *

附上rpm包下载地址如下:

https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch.rpmhttps://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm

3、启动并测试docker

#systemctl start docker#systemctl status docker# docker run hello-world

Hello from Docker!

This message shows that your installation appears to be working correctly.

恭喜,你的docker环境已经搭建成功

如果执行docker run hello-world 之后一直没有结果,可能是网络状态不好,我下面要介绍的内容将改善这个问题。

4、docker 镜像仓库加速配置

c0950b2d1adfa1394fac88bb7e05f622.png

# mkdir -p /etc/docker# tee /etc/docker/daemon.json <{  "registry-mirrors": ["https://y5oqqpjx.mirror.aliyuncs.com"]}EOF# systemctl daemon-reload# systemctl restart docker

配置加速完成,再试启动docker run hello-world,运行正常。

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP