Docker Community Forums

Share and learn in the Docker community.

Symbolic link from host .m2 to container .m2 dependencies

docker
build

(Tibevilaqua) #1

Well, Basically I wanna create a Symbolic link “ln -s” from my host to my container.

To sum up: The .m2 folder of my host must have a Symbolic link to the .m2 folder inside my container, something like: $ ln -s containerIp:/root/.m2 myContainerM2FolderAlias

Goal: Let all dependencies of my project inside a container and don’t have the need to duplicate it in my local host when I develop it with my IDE.

Thanks…


(Timgriffiths) #2

I could walk you thought it, but it would change each time your container is rebuild and it needs to be running all the time. If I was you have a read of the awesome bog by Jessie Frazelle about containerizing your desktop apps. My recommendation would be run your IDE in a container


(Tibevilaqua) #3

Thanks for answering imgriffiths, correct me if I’m wrong… Up to now, docker containers don’t allow us to put an IDE inside a container (there’re no graphical support for such a thing), UNLESS we use a X11 or VNC which in my point of view seems a bit weird, furthermore, the main idea is to create a developing container environment, doing so we fall down in an old personal problem (I like to use IntelliJ, you like Eclipse, a third guy enjoys NetBeans an a fourth enjoys whatever), ir order to “solve this problem” I was thinking about let the IDE outside the container.
The idea of this symbolic link is just to avoid every developer to download/ or having locally the whole .m2 dependencies, deducing that all dependencies are inside a container.

Any idea? Thanks.


(Tibevilaqua) #4

For further investigation about this question. I would like to notify that I’ve “solved” my issue with the same approach than @Kai Hofstetter in the following post: http://stackoverflow.com/questions/28083920/how-to-mount-a-directory-in-the-docker-container-to-the-host