Here is some notes about Docker I learned today.
How to create a Docker base image from scratch
From here.
The basic idea is to use the tool “debootstrap“, which can create a base Debian system by pulling all needed files into a given directory. Then create a tar file upon the directory and import that tar(image) file into Docker. After that the image can be used as any other ones in Docker. Debian is the best Linux distro!
1 | # The first "wily" is the name of the target directory, the |
How to save/load images
One can use Docker save/load commands to persist an image into tar file and vice versa. For an example:
1 | docker save -o wily_latest.tar wily:latest |
Here is an article about the difference between Docker “save” and “export”.
Some other useful commands
1 | # 1. Start a new container instance. |
Install Docker Compose
From here.
1 | # Need root permission to add the following files into system directory. |