HCIP-Cloud Computing-Container V1.0 实验指导手册
1.1 容器镜像
1.1.1 docker commit 构建镜像
步骤 1 在后台运行一个 nginx 容器,取名为 nginx1,并映射到宿主机 80 端口。
[root@localhost ~]# docker run --name nginx1 -d -p 80:80 nginx
步骤 2 在操作机上使用浏览器访问容器 nginx1。
步骤 3 进入容器修改 nginx1 的 index.html 文件内容。
[root@localhost ~]# docker exec -it 7fe26d09e985 bash
步骤 4 验证 nginx1 容器内容修改成功。
[root@localhost ~]# curl 127.0.0.1:80
步骤 5 将容器 nginx1 保存为镜像,新镜像命名为 nginx:v1.1。
[root@localhost ~]# docker commit \
评论0