docker部署安装

1.检查安装的Linux版本:
[root@localhost /]# cat /etc/redhat-release  
CentOS Linux release 7.8.2003 (Core)
2.yum安装gcc相关:
#-y: 安装过程中的提升默认选yes
yum -y install gcc
yum -y install gcc-c++
3.卸载系统中已经安装的Docker版本:
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine

#使用阿里云镜像下载解决报错问题:

yum install -y yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
4.更新yum软件包索引:
yum makecache fast
##安装Docker Engine   #containerd.io
yum install docker-ce docker-ce-cli
5.启动Docker:
#没有报错,docker启动成功
systemctl start docker
#设置开机启动
systemctl enable docker
6.测试Docker是否安装成功:
#看到docker进程
ps -ef|grep docker
#查看版本信息
docker version
#看到运行的镜像
docker images
7.修改国内的镜像地址
cat << EOF > /etc/docker/daemon.json
{
  "registry-mirrors": [
        "https://docker.1panel.live/", 
        "https://docker.anyhub.us.kg",
        "https://docker.anyhub.us.kg",
        "https://dockerhub.icu"
    ],
  "exec-opts":["native.cgroupdriver=systemd"]
}
EOF

systemctl daemon-reload
systemctl restart docker


网易:http://hub-mirror.c.163.com
中科大镜像地址:http://mirrors.ustc.edu.cn/
中科大github地址:https://github.com/ustclug/mirrorrequest
Azure中国镜像地址:http://mirror.azure.cn/
Azure中国github地址:https://github.com/Azure/container-service-for-azure-china
DockerHub镜像仓库: https://hub.docker.com/ 
阿里云镜像仓库: https://cr.console.aliyun.com 
google镜像仓库: https://console.cloud.google.com/gcr/images/google-containers/GLOBAL (如果你本地可以翻墙的话是可以连上去的 )
coreos镜像仓库: https://quay.io/repository/ 
RedHat镜像仓库: https://access.redhat.com/containers
8.安装docker-compose
mkdir /opt/docker
cd /opt/docker

wget https://mirrors.aliyun.com/docker-toolbox/linux/compose/1.21.2/docker-compose-Linux-x86_64

cp -p docker-compose-Linux-x86_64 /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose

docker-compose -v

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值