一、制作一个拥有简易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