Tremble, mortal! 100MB of Redis is compressed to only 7MB! ! !
First, correct the basic concepts:
1.Docker is not a virtual machine (remember)
2. The program in 2.Docker does not need a complete operating system when running!
3. Corios, RHEL, Ubuntu, CentOS, etc. , is an operating system!
How to do it is basically the following steps.
1. Use Busybox's Install command to create a minimized system environment.
2. Delete all kinds of unnecessary system files, which are unnecessary, and then need specific program analysis. The landlord spent a lot of time analyzing each program, and now the landlord can almost recite the dependencies of these apps backwards.
3. Pack these documents to rootfs.tar?
4. Use the ADD instruction of Dockerfile to generate an image with rootfs.tar.
The landlord stopped coding and started coding.
1. Based on Redis 2.8. 13, the simplest rootfs.tar is generated.
Dockerfile file
2. Use this rootfs.tar to generate the smallest Redis image file.
Dockerfile file
Step 3 give it a try
docker run-RM-it-p 6379:6379 microbox/redis
The image generated by this method is no different from the ordinary redis image. Enjoy it, the landlord has already released 30GB of space first.