Dockerfile – gradlew卡在下载

我使用此命令从Dockerfile构buildDocker-image:

docker build -it /root/Documents/myDockerfiles/tomcat/. 

Dockerfile看起来如下所示:

 [root@srv01 ~]# cat /root/Documents/myDockerfiles/tomcat/Dockerfile FROM tomcat:8.0.32-jre8 MAINTAINER "John Doe <johndoe@dough.com>" RUN apt-get update && apt-get install -y git RUN git clone https://myusername:mypassword@mygiturl/mygroup/myproject.git RUN cd ./myproject/ && ./gradlew war 

所以它基本上克隆了一个现有的git-repo,cds到克隆目录,并运行gradle包装器。

问题在于,gradle-wrapper似乎没有与外部的连接,因为:

 Step 5 : RUN cd ./myproject && ./gradlew war ---> Running in d01b57b9f932 Downloading https://services.gradle.org/distributions/gradle-2.3-bin.zip (here its stuck, gradlw can't communicate to the outside) 

我认为它必须是一个防火墙和端口问题 ,因为当我从本地笔记本电脑执行相同的操作时,它不会卡住,而是在我的虚拟机上执行一些Extranet-Cloud-Service (我不能提及的名称)那里。

所以我的问题是:

1.)为什么卡在那里?
2.)我能做些什么来防止它卡在那里?