安装docker
卸载旧版,如果之前没有安装过旧版请忽略
yum remove docker docker-common docker-selinux docker-engine
安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的
yum install -y yum-utils device-mapper-persistent-data lvm2
设置 yum 源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
安装
yum install docker-ce
启动Docker,并设置为开机自启动
systemctl start docker.service
systemctl enable docker.service
安装Docker-Compose
curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
安装Nginx
rpm -ivh https://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum install nginx
启动Nginx,设置开机自启动
systemctl start nginx.service
systemctl enable nginx.service
后续工作
剩下的就是用docker启动各种应用,用nginx代理到外网的事了,此处省略