CentOS 7安装docker

  1. 安装脚本
# 查看系统信息
uname -a

# 官方安装docker脚本
curl -sSL https://get.docker.com/ | sh

# 安装并配置阿里云镜像
curl -fsSL https://get.docker.com | bash -s docker --mirror aliyun

# 阿里云的安装脚本
curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -

# DaoCloud 的安装脚本
curl -sSL https://get.daocloud.io/docker | sh

# 查看版本
docker -v
  1. 配置加速器
    systemctl enable docker
    启动服务后,编辑
vim /etc/systemd/system/multi-user.target.wants/docker.service

在这一行最后添加加速器地址 ExecStart=, eg:

ExecStart=/usr/bin/dockerd --registry-mirror=https://jxus37ad.mirror.aliyuncs.com

重新加载配置并且重新启动。

sudo systemctl daemon-reload
sudo systemctl restart docker

账号登录

docker login --username [username]
  • 同步时间
 # 手动设置
date -s "20210718 22:00:00"

# 网络同步
sudo yum install ntpdate -y
sudo ntpdate cn.pool.ntp.org
  • 报错
    Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
systemctl daemon-reload
sudo service docker restart
sudo service docker status
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值