Well, Basically I wanna create a Symbolic link "ln -s" from my host to my container.
To sum up: the host folder .m2 of the host must have a Symbolic link to the .m2 folder inside my container, something like: $ ln -s containerIp:/root/.m2 myContainerAlias
I've seen the below posts but they didn't help me since I don't wanna copy the files to my local host.
Docker - copy file from container to host
Apache in Docker says: Symbolic link not allowed
https://omarabid.com/symlink-to-a-mounted-volume-in-docker/
Edited:
I've found another valuable Issue here:
How to mount a directory in the docker container to the host? Thanks...
Sounds like you're trying to optimize a Maven build running inside a container?
docker run -it --rm -w /opt/maven \
-v $PWD:/opt/maven \
-v $HOME/.m2:/root/.m2 \
maven:3.3-jdk-8 \
mvn clean install
Example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With