I have a docker container from which I build and package a Java application with maven 3. I have some dependencies deployed to a Nexus server, I can only access through a VPN from local. How can I connect my docker container to that VPN?
docker image details:
Base image : Ubuntu 16.04 LTS as base system
Java 8, maven 3, Tomcat 8 installed
To create my docker container (I didn't add any network configuration):
docker run -it --rm -v '$PWD':/app -w /app/app-parent appImage/v:02 mvn clean install
And that's the error i get:
INFO: I/O exception (java.net.NoRouteToHostException) caught when processing request to {}->http://myserver:80: No route to host (Host unreachable)
May be your problem is due to DNS only.
Try resolving nexus hostname in the container's
/etc/hosts
file (or change mavensettings.xml
so that tag of nexus repository looks for the ip instead of the hostname).To check if that is the problem, simply connect to the container
then try to contact the host (depending on what you installed on the container, you could use ping, wget or other) with hostaname and ip address.