Mysql: docker build step4 returned a non-zero code: 2

Created on 20 May 2016  路  4Comments  路  Source: docker-library/mysql

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

  • apt-get update
    Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
    Get:2 http://security.debian.org jessie/updates/main amd64 Packages [312 kB]
    Ign http://httpredir.debian.org jessie InRelease
    Get:3 http://httpredir.debian.org jessie-updates InRelease [142 kB]
    Get:4 http://httpredir.debian.org jessie Release.gpg [2373 B]
    Get:5 http://httpredir.debian.org jessie Release [148 kB]
    Get:6 http://httpredir.debian.org jessie-updates/main amd64 Packages [9283 B]
    Get:7 http://httpredir.debian.org jessie/main amd64 Packages [9034 kB]
    Fetched 9712 kB in 3s (2890 kB/s)
    Reading package lists...
  • apt-get install -y --no-install-recommends ca-certificates wget
    Reading package lists...
    Building dependency tree...
    Reading state information...
    The following extra packages will be installed:
    libffi6 libgmp10 libgnutls-deb0-28 libhogweed2 libicu52 libidn11 libnettle4
    libp11-kit0 libpsl0 libssl1.0.0 libtasn1-6 openssl
    Suggested packages:
    gnutls-bin
    The following NEW packages will be installed:
    ca-certificates libffi6 libgmp10 libgnutls-deb0-28 libhogweed2 libicu52
    libidn11 libnettle4 libp11-kit0 libpsl0 libssl1.0.0 libtasn1-6 openssl wget
    0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
    Need to get 10.8 MB of archives.
    After this operation, 38.9 MB of additional disk space will be used.
    Get:1 http://security.debian.org/ jessie/updates/main libssl1.0.0 amd64 1.0.1k-3+deb8u5 [1038 kB]
    Get:2 http://httpredir.debian.org/debian/ jessie/main libgmp10 amd64 2:6.0.0+dfsg-6 [253 kB]
    Get:3 http://security.debian.org/ jessie/updates/main libtasn1-6 amd64 4.2-3+deb8u2 [49.0 kB]
    Get:4 http://security.debian.org/ jessie/updates/main libidn11 amd64 1.29-1+deb8u1 [136 kB]
    Get:5 http://security.debian.org/ jessie/updates/main openssl amd64 1.0.1k-3+deb8u5 [677 kB]
    Get:6 http://httpredir.debian.org/debian/ jessie/main libnettle4 amd64 2.7.1-5+deb8u1 [176 kB]
    Get:7 http://httpredir.debian.org/debian/ jessie/main libhogweed2 amd64 2.7.1-5+deb8u1 [126 kB]
    Get:8 http://httpredir.debian.org/debian/ jessie/main libffi6 amd64 3.1-2+b2 [20.1 kB]
    Get:9 http://httpredir.debian.org/debian/ jessie/main libp11-kit0 amd64 0.20.7-1 [81.2 kB]
    Get:10 http://httpredir.debian.org/debian/ jessie/main libgnutls-deb0-28 amd64 3.3.8-6+deb8u3 [694 kB]
    Get:11 http://httpredir.debian.org/debian/ jessie/main libicu52 amd64 52.1-8+deb8u3 [6784 kB]
    Get:12 http://httpredir.debian.org/debian/ jessie/main libpsl0 amd64 0.5.1-1 [41.6 kB]
    Get:13 http://httpredir.debian.org/debian/ jessie/main wget amd64 1.16-1 [495 kB]
    Get:14 http://httpredir.debian.org/debian/ jessie/main ca-certificates all 20141019+deb8u1 [204 kB]
    debconf: delaying package configuration, since apt-utils is not installed
    Fetched 10.8 MB in 1s (5459 kB/s)
    Selecting previously unselected package libssl1.0.0:amd64.
    (Reading database ... 7548 files and directories currently installed.)
    Preparing to unpack .../libssl1.0.0_1.0.1k-3+deb8u5_amd64.deb ...
    Unpacking libssl1.0.0:amd64 (1.0.1k-3+deb8u5) ...
    Selecting previously unselected package libgmp10:amd64.
    Preparing to unpack .../libgmp10_2%3a6.0.0+dfsg-6_amd64.deb ...
    Unpacking libgmp10:amd64 (2:6.0.0+dfsg-6) ...
    Selecting previously unselected package libnettle4:amd64.
    Preparing to unpack .../libnettle4_2.7.1-5+deb8u1_amd64.deb ...
    Unpacking libnettle4:amd64 (2.7.1-5+deb8u1) ...
    Selecting previously unselected package libhogweed2:amd64.
    Preparing to unpack .../libhogweed2_2.7.1-5+deb8u1_amd64.deb ...
    Unpacking libhogweed2:amd64 (2.7.1-5+deb8u1) ...
    Selecting previously unselected package libffi6:amd64.
    Preparing to unpack .../libffi6_3.1-2+b2_amd64.deb ...
    Unpacking libffi6:amd64 (3.1-2+b2) ...
    Selecting previously unselected package libp11-kit0:amd64.
    Preparing to unpack .../libp11-kit0_0.20.7-1_amd64.deb ...
    Unpacking libp11-kit0:amd64 (0.20.7-1) ...
    Selecting previously unselected package libtasn1-6:amd64.
    Preparing to unpack .../libtasn1-6_4.2-3+deb8u2_amd64.deb ...
    Unpacking libtasn1-6:amd64 (4.2-3+deb8u2) ...
    Selecting previously unselected package libgnutls-deb0-28:amd64.
    Preparing to unpack .../libgnutls-deb0-28_3.3.8-6+deb8u3_amd64.deb ...
    Unpacking libgnutls-deb0-28:amd64 (3.3.8-6+deb8u3) ...
    Selecting previously unselected package libidn11:amd64.
    Preparing to unpack .../libidn11_1.29-1+deb8u1_amd64.deb ...
    Unpacking libidn11:amd64 (1.29-1+deb8u1) ...
    Selecting previously unselected package libicu52:amd64.
    Preparing to unpack .../libicu52_52.1-8+deb8u3_amd64.deb ...
    Unpacking libicu52:amd64 (52.1-8+deb8u3) ...
    Selecting previously unselected package libpsl0:amd64.
    Preparing to unpack .../libpsl0_0.5.1-1_amd64.deb ...
    Unpacking libpsl0:amd64 (0.5.1-1) ...
    Selecting previously unselected package wget.
    Preparing to unpack .../archives/wget_1.16-1_amd64.deb ...
    Unpacking wget (1.16-1) ...
    Selecting previously unselected package openssl.
    Preparing to unpack .../openssl_1.0.1k-3+deb8u5_amd64.deb ...
    Unpacking openssl (1.0.1k-3+deb8u5) ...
    Selecting previously unselected package ca-certificates.
    Preparing to unpack .../ca-certificates_20141019+deb8u1_all.deb ...
    Unpacking ca-certificates (20141019+deb8u1) ...
    Setting up libssl1.0.0:amd64 (1.0.1k-3+deb8u5) ...
    debconf: unable to initialize frontend: Dialog
    debconf: (TERM is not set, so the dialog frontend is not usable.)
    debconf: falling back to frontend: Readline
    debconf: unable to initialize frontend: Readline
    debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
    debconf: falling back to frontend: Teletype
    Setting up libgmp10:amd64 (2:6.0.0+dfsg-6) ...
    Setting up libnettle4:amd64 (2.7.1-5+deb8u1) ...
    Setting up libhogweed2:amd64 (2.7.1-5+deb8u1) ...
    Setting up libffi6:amd64 (3.1-2+b2) ...
    Setting up libp11-kit0:amd64 (0.20.7-1) ...
    Setting up libtasn1-6:amd64 (4.2-3+deb8u2) ...
    Setting up libgnutls-deb0-28:amd64 (3.3.8-6+deb8u3) ...
    Setting up libidn11:amd64 (1.29-1+deb8u1) ...
    Setting up libicu52:amd64 (52.1-8+deb8u3) ...
    Setting up libpsl0:amd64 (0.5.1-1) ...
    Setting up wget (1.16-1) ...
    Setting up openssl (1.0.1k-3+deb8u5) ...
    Setting up ca-certificates (20141019+deb8u1) ...
    debconf: unable to initialize frontend: Dialog
    debconf: (TERM is not set, so the dialog frontend is not usable.)
    debconf: falling back to frontend: Readline
    debconf: unable to initialize frontend: Readline
    debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
    debconf: falling back to frontend: Teletype
    Processing triggers for libc-bin (2.19-18+deb8u4) ...
    Processing triggers for ca-certificates (20141019+deb8u1) ...
    Updating certificates in /etc/ssl/certs... 174 added, 0 removed; done.
    Running hooks in /etc/ca-certificates/update.d....done.
  • rm -rf /var/lib/apt/lists/httpredir.debian.org_debian_dists_jessie-updates_InRelease /var/lib/apt/lists/httpredir.debian.org_debian_dists_jessie-updates_main_binary-amd64_Packages.gz /var/lib/apt/lists/httpredir.debian.org_debian_dists_jessie_Release /var/lib/apt/lists/httpredir.debian.org_debian_dists_jessie_Release.gpg /var/lib/apt/lists/httpredir.debian.org_debian_dists_jessie_main_binary-amd64_Packages.gz /var/lib/apt/lists/lock /var/lib/apt/lists/partial /var/lib/apt/lists/security.debian.org_dists_jessie_updates_InRelease /var/lib/apt/lists/security.debian.org_dists_jessie_updates_main_binary-amd64_Packages.gz
  • dpkg --print-architecture
  • wget -O /usr/local/bin/gosu https://github.com/tianon/gosu/releases/download/1.7/gosu-amd64
    converted 'https://github.com/tianon/gosu/releases/download/1.7/gosu-amd64' (ANSI_X3.4-1968) -> 'https://github.com/tianon/gosu/releases/download/1.7/gosu-amd64' (UTF-8)
    --2016-05-20 09:44:03-- https://github.com/tianon/gosu/releases/download/1.7/gosu-amd64
    Resolving github.com (github.com)... 192.30.252.129
    Connecting to github.com (github.com)|192.30.252.129|:443... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: https://github-cloud.s3.amazonaws.com/releases/19708981/40d1b00c-8619-11e5-8953-d0122dcf07b9?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160520%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160520T094404Z&X-Amz-Expires=300&X-Amz-Signature=f66a8b7f0abdbf42200dde2a470ca380efab76c58b1566b6ad5c35dd8284d95f&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dgosu-amd64&response-content-type=application%2Foctet-stream [following]
    converted 'https://github-cloud.s3.amazonaws.com/releases/19708981/40d1b00c-8619-11e5-8953-d0122dcf07b9?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160520%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160520T094404Z&X-Amz-Expires=300&X-Amz-Signature=f66a8b7f0abdbf42200dde2a470ca380efab76c58b1566b6ad5c35dd8284d95f&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dgosu-amd64&response-content-type=application%2Foctet-stream' (ANSI_X3.4-1968) -> 'https://github-cloud.s3.amazonaws.com/releases/19708981/40d1b00c-8619-11e5-8953-d0122dcf07b9?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ/20160520/us-east-1/s3/aws4_request&X-Amz-Date=20160520T094404Z&X-Amz-Expires=300&X-Amz-Signature=f66a8b7f0abdbf42200dde2a470ca380efab76c58b1566b6ad5c35dd8284d95f&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment; filename=gosu-amd64&response-content-type=application/octet-stream' (UTF-8)
    --2016-05-20 09:44:04-- https://github-cloud.s3.amazonaws.com/releases/19708981/40d1b00c-8619-11e5-8953-d0122dcf07b9?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ/20160520/us-east-1/s3/aws4_request&X-Amz-Date=20160520T094404Z&X-Amz-Expires=300&X-Amz-Signature=f66a8b7f0abdbf42200dde2a470ca380efab76c58b1566b6ad5c35dd8284d95f&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment;%20filename=gosu-amd64&response-content-type=application/octet-stream
    Resolving github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)... 54.231.98.144
    Connecting to github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)|54.231.98.144|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 2698808 (2.6M) [application/octet-stream]
    Saving to: '/usr/local/bin/gosu'

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]

  • dpkg --print-architecture
  • wget -O /usr/local/bin/gosu.asc https://github.com/tianon/gosu/releases/download/1.7/gosu-amd64.asc
    converted 'https://github.com/tianon/gosu/releases/download/1.7/gosu-amd64.asc' (ANSI_X3.4-1968) -> 'https://github.com/tianon/gosu/releases/download/1.7/gosu-amd64.asc' (UTF-8)
    --2016-05-20 09:44:05-- https://github.com/tianon/gosu/releases/download/1.7/gosu-amd64.asc
    Resolving github.com (github.com)... 192.30.252.129
    Connecting to github.com (github.com)|192.30.252.129|:443... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: https://github-cloud.s3.amazonaws.com/releases/19708981/40e5b35e-8619-11e5-98cb-8377dd5f2aac.asc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160520%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160520T094406Z&X-Amz-Expires=300&X-Amz-Signature=90423f1912ce3822594884d994d2e186567e6e2a42d7d0d5a19263b9d4891039&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dgosu-amd64.asc&response-content-type=application%2Foctet-stream [following]
    converted 'https://github-cloud.s3.amazonaws.com/releases/19708981/40e5b35e-8619-11e5-98cb-8377dd5f2aac.asc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160520%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160520T094406Z&X-Amz-Expires=300&X-Amz-Signature=90423f1912ce3822594884d994d2e186567e6e2a42d7d0d5a19263b9d4891039&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dgosu-amd64.asc&response-content-type=application%2Foctet-stream' (ANSI_X3.4-1968) -> 'https://github-cloud.s3.amazonaws.com/releases/19708981/40e5b35e-8619-11e5-98cb-8377dd5f2aac.asc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ/20160520/us-east-1/s3/aws4_request&X-Amz-Date=20160520T094406Z&X-Amz-Expires=300&X-Amz-Signature=90423f1912ce3822594884d994d2e186567e6e2a42d7d0d5a19263b9d4891039&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment; filename=gosu-amd64.asc&response-content-type=application/octet-stream' (UTF-8)
    --2016-05-20 09:44:06-- https://github-cloud.s3.amazonaws.com/releases/19708981/40e5b35e-8619-11e5-98cb-8377dd5f2aac.asc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ/20160520/us-east-1/s3/aws4_request&X-Amz-Date=20160520T094406Z&X-Amz-Expires=300&X-Amz-Signature=90423f1912ce3822594884d994d2e186567e6e2a42d7d0d5a19263b9d4891039&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment;%20filename=gosu-amd64.asc&response-content-type=application/octet-stream
    Resolving github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)... 54.231.98.144
    Connecting to github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)|54.231.98.144|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 543 [application/octet-stream]
    Saving to: '/usr/local/bin/gosu.asc'

0K 100% 13.4M=0s

2016-05-20 09:44:06 (13.4 MB/s) - '/usr/local/bin/gosu.asc' saved [543/543]

  • mktemp -d
  • export GNUPGHOME=/tmp/tmp.vOb75V4YMF
  • gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
    gpg: keyring /tmp/tmp.vOb75V4YMF/secring.gpg' created gpg: keyring/tmp/tmp.vOb75V4YMF/pubring.gpg' created
    gpg: requesting key BF357DD4 from hkp server ha.pool.sks-keyservers.net
    gpg: keyserver timed out
    gpg: keyserver receive failed: keyserver error
    The command '/bin/sh -c 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' returned a non-zero code: 2

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 just docker pull the image) you can edit the Dockerfile to use port 80 keyservers: hkp://p80.pool.sks-keyservers.net:80.

All 4 comments

That 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?

Was this page helpful?
0 / 5 - 0 ratings