手动制作镜像

制作基于CentOS6.9的nginx镜像

准备镜像及容器

# 拉取镜像
docker pull centos:6.9

# 启动并进入容器
docker run --name web01 -it -p 80:80 centos:6.9 /bin/bash

安装环境

# 配置国内软件源
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
curl -o /etc/yum.repos.d/epel-6.repo http://mirrors.aliyun.com/repo/epel-6.repo


# 安装 nginx
yum install nginx -y


# 启动nginx
nginx -g 'daemon off;'


# 访问测试
# 退出容器

提交镜像

运行测试

制作PHP环境的镜像(运行可道云)

准备镜像及容器

安装环境

将容器提交为镜像

将容器直接导出为文件

运行测试

制作MySQL环境的镜像(运行phpwind)

准备镜像及容器

安装环境

提交镜像

运行测试

file-archive
12MB
triangle-exclamation

万能hang住命令:tail -F <file>

Last updated