linux下docker安装
1、关闭/禁用防火墙
1.1关闭防火墙
service firewalld stop
1.2禁用防火墙
systemctl disable firewalld
2、docker安装
2.1、卸载老版本
yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
2.2、安装
yum install -y yum-utils \ device-mapper-persistent-data \ lvm2
yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io
3、启动docker
3.1、启动
systemctl start docker
# 或
service docker start
3.2、设置开机自启动
systemctl enable docker
4、docker镜像仓库配置
4.1、创建配置文件
touch /etc/docker/daemon.json
4.2、编辑配置文件
vi /etc/docker/daemon.json
{
"insecure-registries": [
"192.168.1.61:5001"
],
"log-driver":"json-file",
"log-opts": {"max-size":"500m", "max-file":"3"}
}
4.3、重启docker服务
service docker restart