J
J
johnmohnachev2016-09-29 12:34:27
macOS
johnmohnachev, 2016-09-29 12:34:27

Is it possible to move the application from Docker to the parent system?

Is it possible to run a container with Java 1.8 and use the java command on the parent system? Likewise with npm, nodejs, etc.
There are no problems with the databases, I forward the port and the client on the parent machine connects via the forwarded port to the database in the container, I'm interested in a similar possibility with applications.
I want to rid the parent OS of various applications like java, npm, nodejs, etc. It also helped solve the problem when projects use different versions of Java or nodejs for example.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Oleg Tsilyurik, 2016-09-29
@Olej

Is it possible to run a container with Java 1.8 and use the java command on the parent system?

No impossible.
You, apparently, do not understand well what you have created in Docker - it is, in fact, another, virtual, isolated machine ... albeit without virtualization, it is beautifully called a "container".
Of course, you can communicate with this host using TCP/IP (which is what you do with the database), but otherwise you must treat the container as an isolated host.

P
Philipp, 2016-09-29
@zoonman

docker attach
docker exec
The whole point of docker is to rid the parent machine of dependencies.
Run all the commands you need inside the docker container, with the right software versions and dependencies.

C
chersanya, 2016-10-03
@chersanya

In general, it is possible, and quite convenient - I use texlive (latexmk, pdflatex), python (notebook), I tried pycharm (etc. - https://github.com/aplavin/dockerfiles). For non-graphical programs, it's usually simple - the desired folder is attached to the container as a volume, for convenience, you can make a script that takes this very folder as an argument and launches what you need. For graphics, you also need to forward the X-server socket, but also, in general, nothing complicated.
True, I did not try it separately with java.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question