安装Docker
yum install -y yum-utils device-mapper-persistent-data lvm2
wget http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
yum -y install epel-release
yum makecache fast
yum clean all
yum -y install docker-ce
systemctl enable docker
systemctl restart docker
拉取BLOG以及对应数据库镜像
docker pull registry.cn-hangzhou.aliyuncs.com/13/myblog:mysql
docker pull registry.cn-hangzhou.aliyuncs.com/13/myblog:blog
docker run \
--name mysql \
-p 13306:3306 \
-d registry.cn-hangzhou.aliyuncs.com/13/myblog:mysql
docker run \
--name my-blog \
-p 28080:8080 \
--link mysql \
-v /data/blog/webapps/app.jar:/app.jar \
-d registry.cn-hangzhou.aliyuncs.com/13/myblog:blog
首页地址:http://localhost:28080
后台地址:http://localhost:28080/admin
默认账号密码:admin 123456