Step 4 : RUN set -x && apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc"&& export GNUPGHOME="$(mktemp -d)" && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc && chmod +x /usr/local/bin/gosu && gosu nobody true && apt-get purge -y --auto-remove ca-certificates wget
---> Running in 1f2c309c3e6f
0K .......... .......... .......... .......... .......... 1% 307K 8s
50K .......... .......... .......... .......... .......... 3% 307K 8s
100K .......... .......... .......... .......... .......... 5% 80.4M 5s
150K .......... .......... .......... .......... .......... 7% 612K 5s
200K .......... .......... .......... .......... .......... 9% 618K 5s
250K .......... .......... .......... .......... .......... 11% 42.4M 4s
300K .......... .......... .......... .......... .......... 13% 624K 4s
350K .......... .......... .......... .......... .......... 15% 34.7M 3s
400K .......... .......... .......... .......... .......... 17% 141M 3s
450K .......... .......... .......... .......... .......... 18% 631K 3s
500K .......... .......... .......... .......... .......... 20% 38.7M 2s
550K .......... .......... .......... .......... .......... 22% 33.6M 2s
600K .......... .......... .......... .......... .......... 24% 155M 2s
650K .......... .......... .......... .......... .......... 26% 157M 2s
700K .......... .......... .......... .......... .......... 28% 689K 2s
750K .......... .......... .......... .......... .......... 30% 8.16M 2s
800K .......... .......... .......... .......... .......... 32% 26.5M 2s
850K .......... .......... .......... .......... .......... 34% 35.0M 1s
900K .......... .......... .......... .......... .......... 36% 62.8M 1s
950K .......... .......... .......... .......... .......... 37% 83.0M 1s
1000K .......... .......... .......... .......... .......... 39% 1.46M 1s
1050K .......... .......... .......... .......... .......... 41% 1.30M 1s
1100K .......... .......... .......... .......... .......... 43% 56.2M 1s
1150K .......... .......... .......... .......... .......... 45% 7.60M 1s
1200K .......... .......... .......... .......... .......... 47% 66.9M 1s
1250K .......... .......... .......... .......... .......... 49% 37.1M 1s
1300K .......... .......... .......... .......... .......... 51% 40.0M 1s
1350K .......... .......... .......... .......... .......... 53% 98.5M 1s
1400K .......... .......... .......... .......... .......... 55% 1.52M 1s
1450K .......... .......... .......... .......... .......... 56% 37.0M 1s
1500K .......... .......... .......... .......... .......... 58% 1.31M 1s
1550K .......... .......... .......... .......... .......... 60% 55.8M 1s
1600K .......... .......... .......... .......... .......... 62% 8.56M 1s
1650K .......... .......... .......... .......... .......... 64% 40.4M 0s
1700K .......... .......... .......... .......... .......... 66% 15.6M 0s
1750K .......... .......... .......... .......... .......... 68% 43.8M 0s
1800K .......... .......... .......... .......... .......... 70% 159M 0s
1850K .......... .......... .......... .......... .......... 72% 134M 0s
1900K .......... .......... .......... .......... .......... 73% 155M 0s
1950K .......... .......... .......... .......... .......... 75% 158M 0s
2000K .......... .......... .......... .......... .......... 77% 137M 0s
2050K .......... .......... .......... .......... .......... 79% 133M 0s
2100K .......... .......... .......... .......... .......... 81% 1.67M 0s
2150K .......... .......... .......... .......... .......... 83% 38.3M 0s
2200K .......... .......... .......... .......... .......... 85% 143M 0s
2250K .......... .......... .......... .......... .......... 87% 138M 0s
2300K .......... .......... .......... .......... .......... 89% 1.30M 0s
2350K .......... .......... .......... .......... .......... 91% 61.6M 0s
2400K .......... .......... .......... .......... .......... 92% 70.3M 0s
2450K .......... .......... .......... .......... .......... 94% 11.5M 0s
2500K .......... .......... .......... .......... .......... 96% 47.1M 0s
2550K .......... .......... .......... .......... .......... 98% 78.2M 0s
2600K .......... .......... .......... ..... 100% 53.6M=1.0s
2016-05-20 09:44:05 (2.62 MB/s) - '/usr/local/bin/gosu' saved [2698808/2698808]
0K 100% 13.4M=0s
2016-05-20 09:44:06 (13.4 MB/s) - '/usr/local/bin/gosu.asc' saved [543/543]
/tmp/tmp.vOb75V4YMF/secring.gpg' created
gpg: keyring/tmp/tmp.vOb75V4YMF/pubring.gpg' createdThat looks like you were unable to download the key file: keyserver receive failed. If you are behind a firewall (and also unable to just docker pull the image) you can edit the Dockerfile to use port 80 keyservers: hkp://p80.pool.sks-keyservers.net:80.
OK,I changed the keyserver,it works. Thank you very much
@yosifkit it works, thanks.
Can you please explain a bit more about why?
I am able to import gpg keys on my host using regular pool.sks-keyservers.net but when it comes to docker it fails often, so I have to switch to hkp://p80.pool.sks-keyservers.net:80 but I have no glue why.
And on some hosts it does not fail at all.
I have similar issues when building on my local machine, which is behind a proxy. The Docker container won't automatically use the proxy settings from the host machines, so it needs to be added to the Dockerfile to work.
In your case I guess the firewall blocks the port usually used by keyserver, but allows the traffic on port 80. Your host may have this set up properly, but as noted above this setup wouldn't be passed down to the Docker container.
Not sure why it works on some hosts. Maybe they are not behind the same firewall?
Most helpful comment
That looks like you were unable to download the key file:
keyserver receive failed. If you are behind a firewall (and also unable to justdocker pullthe image) you can edit the Dockerfile to use port 80 keyservers:hkp://p80.pool.sks-keyservers.net:80.