All processes in the Docker Container
are isolated.
So By design your Host programs are not available inside the Docker image.
Technically, you do not need Alpine
or Ubuntu
Linux base image. For example you can use the Scratch
image: https://hub.docker.com/_/scratch
Idea of the docker is to provide fully isolated exactly the same environment for application, they do not force to use any base image.
However it's good to use official base image because:
- You have a lot of tutorials about common distributions
- You have a lot of preinstalled tools provided with base image.
- Official images are maintained by community so they are fixing issues for you.
Docker uses layer design, to minimize size of images. More info here: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…