Docker---镜像管理

本文介绍了如何制作并管理Docker镜像,包括创建拥有简易index主页的busybox镜像,以及制作使用httpd命令在前端运行的busybox镜像,并进行了测试验证。同时,还涉及到了镜像的打包过程。
摘要由CSDN通过智能技术生成

一、制作一个拥有简易index主页的busybox镜像 

首先,起一个终端tty1,运行busybox,创建一个简易主页。

[root@bogon ~]# docker run --name b1 -it busybox
/ # mkdir -p /data/httpd
/ # vi /data/httpd/index.html

            <h1>Hello docker </h1>

而后,在另起一个终端tty2,查看如何创建镜像,并且tty1的docker 不关闭运行。

[root@bogon ~]# docker commit -h  # Create a new image from a container's changes

Usage:  docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]

Create a new image from a container's changes

Options:
  -a, --author string    Author (e.g., "John Hannibal Smith <hannibal@a-team.com>")
  -c, --change list      Apply Dockerfile instruction to the created image
  -m, --message string   Commit message
  -p, --pause            Pause container during commit (default true)

创建一个本地裸镜像

[root@bogon ~]# docke
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值