Docker快速部署文档(只需要CV即可~)

Docker快速部署文档

1.安装/更新wget镜像

yum install wget -y

2.删除旧版本docker

yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine

3.配置镜像

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

4.镜像清除缓存重启

yum clean all
yum makecache

5.安装相关工具

yum install -y bash-completion vim lrzsz wget expect nettools nc nmap tree dos2unix htop iftop iotop unzip telnet slpsmisc nethogs glances bc ntpdate openldap-devel

6.开启linux内核流量转发(编写文件进去)

cat < /etc/sysctl.d/docker.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
net.ipv4.ip_forward=1
EOF

7.修改内核参数和修改配置文件

modprobe br_netfilter
sysctl -p /etc/sysctl.d/docker.conf

8.配置docekr镜像

curl -o /etc/yum.repos.d/docker-ce.repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
curl -o /etc/yum.repos.d/Centos-7.repo http://mirrors.aliyun.com/repo/Centos-7.repo

9.清除缓存重启

yum clean all && yum makecache

10.docker安装

yum install docker-ce-20.10.6 -y

11.查看yum源可下载版本

yum list docker-ce --showduplicates | sort -r

12.卸载docker

yum remove -y docker-xxx

13.安装完后需要配置docker镜像仓库

mkdir -p /etc/docker
touch /etc/docker/daemon.json
vim /etc/docker/daemon.json
cat /etc/docker/daemon.json
{
 "registry-mirrors" : ["https://8xpk5wnt.mirror.aliyuncs.com"]
}

14.重新启动docker并设为开机自启动

systemctl daemon-reload
systemctl enable docker 
systemctl restart docker

——docker容器安装完成————

接下来是部署应用环节~~~

你可能感兴趣的:(计算机小知识~,docker,linux,centos)