4.3 Do not install unnecessary packages in the container

Information

https://docs.docker.com/userguide/dockerimages/
2.http://www.livewyer.com/blog/2015/02/24/slimming-down-your-docker-containers-alpine-linux
3.https://github.com/progrium/busybox

Solution

At the outset, do not install anything on the container that does not justify the purpose. If the image had some packages that your container does not use, uninstall them.
Consider using a minimal base image rather than the standard Redhat/Centos/Debian images if you can. Some of the options include BusyBox and Alpine.
Not only does this trim your image size from >150Mb to ~20 Mb, there are also fewer tools and paths to escalate privileges. You can even remove the package installer as a final hardening measure for leaf/production containers.
Impact-
None.
Default Value-
Not Applicable.

See Also

https://workbench.cisecurity.org/files/516

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-7

Plugin: Unix

Control ID: be669b40ec526cd96b1987e6256a77d8ac77acef788e297aab5f2c7a1e015dce