title: Cannot download poms and jars from maven repo in docker
body: <p>I want to develop in docker. So I use the maven docker. Here is the dockerfile:</p>
  
  <pre><code>FROM maven:3.5.4
  MAINTAINER xxx &lt;xxx@xxx.com&gt;
  COPY . /app
  WORKDIR /app
  RUN mvn clean compile
  CMD mvn spring-boot:run
  </code></pre>
  
  <p>But there is the error</p>
  
  <pre><code>Building webapp
  Step 1/6 : FROM maven:3.5.4
   ---&gt; 745b8a8c4bc7
  Step 2/6 : MAINTAINER xxx &lt;xxx@xxx.com&gt;
   ---&gt; Using cache
   ---&gt; 86bfe1b29459
  Step 3/6 : COPY . /app
   ---&gt; Using cache
   ---&gt; 2013b90d35bb
  Step 4/6 : WORKDIR /app
   ---&gt; Using cache
   ---&gt; c735cc45bcd7
  Step 5/6 : RUN mvn clean compile
   ---&gt; Running in 5a9db90f7b13
  [INFO] Scanning for projects...
  Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.0.0.RELEASE/spring-boot-starter-parent-2.0.0.RELEASE.pom
  [ERROR] [ERROR] Some problems were encountered while processing the POMs:
  [FATAL] Non-resolvable parent POM for io.github.xxx:spring-boot-my-demo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.0.RELEASE from/to central (https://repo.maven.apache.org/maven2): Invalid argument or cannot assign requested address and 'parent.relativePath' points at no local POM @ line 14, column 10
   @
  [ERROR] The build could not read 1 project -&gt; [Help 1]
  [ERROR]
  [ERROR]   The project io.github.xxx:spring-boot-my-demo:0.0.1-SNAPSHOT (/app/pom.xml) has 1 error
  [ERROR]     Non-resolvable parent POM for io.github.xxx:spring-boot-my-demo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.0.RELEASE from/to central (https://repo.maven.apache.org/maven2): Invalid argument or cannot assign requested address and 'parent.relativePath' points at no local POM @ line 14, column 10 -&gt; [Help 2]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
  [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
  ERROR: Service 'webapp' failed to build: The command '/bin/sh -c mvn clean compile' returned a non-zero code: 1
  </code></pre>
  
  <p>I went into the docker and run <code>mvn clean compile -X</code>:</p>
  
  <pre><code>...
  Caused by: java.net.SocketException: Invalid argument or cannot assign requested address
      at java.net.PlainSocketImpl.socketConnect (Native Method)
      at java.net.AbstractPlainSocketImpl.doConnect (AbstractPlainSocketImpl.java:350)
      at java.net.AbstractPlainSocketImpl.connectToAddress (AbstractPlainSocketImpl.java:206)
      at java.net.AbstractPlainSocketImpl.connect (AbstractPlainSocketImpl.java:188)
      at java.net.SocksSocketImpl.connect (SocksSocketImpl.java:392)
      at java.net.Socket.connect (Socket.java:589)
  </code></pre>
  
  <p>If I use <code>curl</code> to get the pom directly:</p>
  
  <pre><code>root@faee9f5ca168:/app# curl https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.0.0.RELEASE/spring-boot-starter-parent-2.0.0.RELEASE.pom
  curl: (7) Couldn't connect to server
  </code></pre>
  
  <p>But it works well on my host machine.</p>
  
  <p>And curl other pages works fine in the docker. I just cannot connect to  the maven repo. Can anyone help me?</p>