Share executable between docker images

2019-08-26 01:07发布

问题:

Maybe it is really lame question, but would it be possible to share some executables to all docker containers at once?

The reason is i.e. JDK part of the image is pretty big, why not put the binaries in some volume and then just execute java command from there?

Is it feasible at all or nonsense from the start?

回答1:

The reason is i.e. JDK part of the image is pretty big, why not put the binaries in some volume and then just execute java command from there?

Docker images should be portable, and you should be able to start your image anywhere where Docker is installed. If you don't package all the dependencies inside the image, the image will not be portable on any machine.