Accessing Host Java from Docker container

前端 未结 2 884
-上瘾入骨i
-上瘾入骨i 2021-01-27 07:36

I have Java installed in my docker host. Now I want that to be able to my docker containers. I don\'t want to install again on the containers. Do we have any workaround for that

2条回答
  •  鱼传尺愫
    2021-01-27 08:19

    Well it defeat the purpose of using Docker that is to decouple your container from the host.

    If you are looking for a workaround you can probably just mount your Java host installation directory in you container but is better to use the same OS both in the container and in the host

    I think is a not worth it and you don't have to "install" Java just start from an Image (or create one yourself) that already contains Java, with open jdk is pretty simple.

提交回复
热议问题