With a learning attitude, I want to know how to create a basic docker image. So I found a description on the official docker website:
First, the creation of base image is related to the Linux release version to be created. Different releases are different.
The following are examples:
Use the tar command to create a complete image
Use debootstrap to create Ubuntu base image
$ sudo debootstrap raring raring > /dev/null$ sudo tar -C raring -c . | sudo docker import - raringa29c15f1bf7a$ sudo docker run raring cat /etc/lsb-releaseDISTRIB_ID=UbuntuDISTRIB_RELEASE=13.04DISTRIB_CODENAME=raringDISTRIB_DESCRIPTION="Ubuntu 13.04"
2. Use scratch to create a base image
There is a scratch in docker registry, and an empty tar file is used to create an image.
$ tar cv --files-from /dev/null | docker import - scratch
Now you can use docker pull to create an image from the smallest container:
FROM scratchCOPY true-asm /trueCMD ["/true"]
The above is dockerfile.
Create a base image using docker