nginxinc/docker-nginx-amplify

Build fails on macOS host

Closed this issue · 5 comments

JanC commented

Hi,
I'm trying to build the image by following the guide but it fails on:

The command '/bin/sh -c apt-get update     && apt-get install -qqy curl python apt-transport-https apt-utils gnupg1 procps     && echo 'deb https://packages.amplify.nginx.com/debian/ stretch amplify-agent' > /etc/apt/sources.list.d/nginx-amplify.list     && curl -fs https://nginx.org/keys/nginx_signing.key | apt-key add - > /dev/null 2>&1     && apt-get update     && apt-get install -qqy nginx-amplify-agent     && apt-get purge -qqy curl apt-transport-https apt-utils gnupg1     && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 2

Versions:

Docker version 17.12.0-ce, build c97c6d6

macOS High Sierra: 10.13.3

It look similar to the #6 but it's from 2016 so I open a new one :)

I tried on a Ubuntu host (running in a vm on the same machine) where it builds fine so it does not seem to be an network issue

Full log:

docker build -t nginx-amplify .
Sending build context to Docker daemon  202.8kB
Step 1/7 : FROM nginx:1.13
 ---> e548f1a579cf
Step 2/7 : MAINTAINER NGINX Amplify Engineering
 ---> Using cache
 ---> 4d65c0821122
Step 3/7 : RUN apt-get update     && apt-get install -qqy curl python apt-transport-https apt-utils gnupg1 procps     && echo 'deb https://packages.amplify.nginx.com/debian/ stretch amplify-agent' > /etc/apt/sources.list.d/nginx-amplify.list     && curl -fs https://nginx.org/keys/nginx_signing.key | apt-key add - > /dev/null 2>&1     && apt-get update     && apt-get install -qqy nginx-amplify-agent     && apt-get purge -qqy curl apt-transport-https apt-utils gnupg1     && rm -rf /var/lib/apt/lists/*
 ---> Running in 4d57cd9ea754
Get:1 http://security.debian.org stretch/updates InRelease [63.0 kB]
Ign:2 http://cdn-fastly.deb.debian.org/debian stretch InRelease
Get:4 http://security.debian.org stretch/updates/main amd64 Packages [415 kB]
Get:3 http://cdn-fastly.deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:5 http://cdn-fastly.deb.debian.org/debian stretch Release [118 kB]
Get:6 http://cdn-fastly.deb.debian.org/debian stretch-updates/main amd64 Packages [8431 B]
Get:7 http://cdn-fastly.deb.debian.org/debian stretch Release.gpg [2434 B]
Get:8 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 Packages [9531 kB]
Fetched 10.2 MB in 2s (4374 kB/s)
Reading package lists...
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libpython2.7-minimal:amd64.
(Reading database ... 7027 files and directories currently installed.)
Preparing to unpack .../00-libpython2.7-minimal_2.7.13-2+deb9u2_amd64.deb ...
Unpacking libpython2.7-minimal:amd64 (2.7.13-2+deb9u2) ...
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../01-python2.7-minimal_2.7.13-2+deb9u2_amd64.deb ...
Unpacking python2.7-minimal (2.7.13-2+deb9u2) ...
Selecting previously unselected package python-minimal.
Preparing to unpack .../02-python-minimal_2.7.13-2_amd64.deb ...
Unpacking python-minimal (2.7.13-2) ...
Selecting previously unselected package mime-support.
Preparing to unpack .../03-mime-support_3.60_all.deb ...
Unpacking mime-support (3.60) ...
Selecting previously unselected package libffi6:amd64.
Preparing to unpack .../04-libffi6_3.2.1-6_amd64.deb ...
Unpacking libffi6:amd64 (3.2.1-6) ...
Selecting previously unselected package readline-common.
Preparing to unpack .../05-readline-common_7.0-3_all.deb ...
Unpacking readline-common (7.0-3) ...
Selecting previously unselected package libreadline7:amd64.
Preparing to unpack .../06-libreadline7_7.0-3_amd64.deb ...
Unpacking libreadline7:amd64 (7.0-3) ...
Selecting previously unselected package libsqlite3-0:amd64.
Preparing to unpack .../07-libsqlite3-0_3.16.2-5+deb9u1_amd64.deb ...
Unpacking libsqlite3-0:amd64 (3.16.2-5+deb9u1) ...
Selecting previously unselected package libpython2.7-stdlib:amd64.
Preparing to unpack .../08-libpython2.7-stdlib_2.7.13-2+deb9u2_amd64.deb ...
Unpacking libpython2.7-stdlib:amd64 (2.7.13-2+deb9u2) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../09-python2.7_2.7.13-2+deb9u2_amd64.deb ...
Unpacking python2.7 (2.7.13-2+deb9u2) ...
Selecting previously unselected package libpython-stdlib:amd64.
Preparing to unpack .../10-libpython-stdlib_2.7.13-2_amd64.deb ...
Unpacking libpython-stdlib:amd64 (2.7.13-2) ...
Setting up libpython2.7-minimal:amd64 (2.7.13-2+deb9u2) ...
Setting up python2.7-minimal (2.7.13-2+deb9u2) ...
Linking and byte-compiling packages for runtime python2.7...
Setting up python-minimal (2.7.13-2) ...
Selecting previously unselected package python.
(Reading database ... 7836 files and directories currently installed.)
Preparing to unpack .../00-python_2.7.13-2_amd64.deb ...
Unpacking python (2.7.13-2) ...
Selecting previously unselected package libapt-inst2.0:amd64.
Preparing to unpack .../01-libapt-inst2.0_1.4.8_amd64.deb ...
Unpacking libapt-inst2.0:amd64 (1.4.8) ...
Selecting previously unselected package apt-utils.
Preparing to unpack .../02-apt-utils_1.4.8_amd64.deb ...
Unpacking apt-utils (1.4.8) ...
Selecting previously unselected package libprocps6:amd64.
Preparing to unpack .../03-libprocps6_2%3a3.3.12-3_amd64.deb ...
Unpacking libprocps6:amd64 (2:3.3.12-3) ...
Selecting previously unselected package libssl1.0.2:amd64.
Preparing to unpack .../04-libssl1.0.2_1.0.2l-2+deb9u2_amd64.deb ...
Unpacking libssl1.0.2:amd64 (1.0.2l-2+deb9u2) ...
Selecting previously unselected package procps.
Preparing to unpack .../05-procps_2%3a3.3.12-3_amd64.deb ...
Unpacking procps (2:3.3.12-3) ...
Selecting previously unselected package bzip2.
Preparing to unpack .../06-bzip2_1.0.6-8.1_amd64.deb ...
Unpacking bzip2 (1.0.6-8.1) ...
Selecting previously unselected package libmagic-mgc.
Preparing to unpack .../07-libmagic-mgc_1%3a5.30-1+deb9u1_amd64.deb ...
Unpacking libmagic-mgc (1:5.30-1+deb9u1) ...
Selecting previously unselected package libmagic1:amd64.
Preparing to unpack .../08-libmagic1_1%3a5.30-1+deb9u1_amd64.deb ...
Unpacking libmagic1:amd64 (1:5.30-1+deb9u1) ...
Selecting previously unselected package file.
Preparing to unpack .../09-file_1%3a5.30-1+deb9u1_amd64.deb ...
Unpacking file (1:5.30-1+deb9u1) ...
Selecting previously unselected package krb5-locales.
Preparing to unpack .../10-krb5-locales_1.15-1+deb9u1_all.deb ...
Unpacking krb5-locales (1.15-1+deb9u1) ...
Selecting previously unselected package libgmp10:amd64.
Preparing to unpack .../11-libgmp10_2%3a6.1.2+dfsg-1_amd64.deb ...
Unpacking libgmp10:amd64 (2:6.1.2+dfsg-1) ...
Selecting previously unselected package libnettle6:amd64.
Preparing to unpack .../12-libnettle6_3.3-1+b2_amd64.deb ...
Unpacking libnettle6:amd64 (3.3-1+b2) ...
Selecting previously unselected package libhogweed4:amd64.
Preparing to unpack .../13-libhogweed4_3.3-1+b2_amd64.deb ...
Unpacking libhogweed4:amd64 (3.3-1+b2) ...
Selecting previously unselected package libidn11:amd64.
Preparing to unpack .../14-libidn11_1.33-1_amd64.deb ...
Unpacking libidn11:amd64 (1.33-1) ...
Selecting previously unselected package libp11-kit0:amd64.
Preparing to unpack .../15-libp11-kit0_0.23.3-2_amd64.deb ...
Unpacking libp11-kit0:amd64 (0.23.3-2) ...
Selecting previously unselected package libtasn1-6:amd64.
Preparing to unpack .../16-libtasn1-6_4.10-1.1+deb9u1_amd64.deb ...
Unpacking libtasn1-6:amd64 (4.10-1.1+deb9u1) ...
Selecting previously unselected package libgnutls30:amd64.
Preparing to unpack .../17-libgnutls30_3.5.8-5+deb9u3_amd64.deb ...
Unpacking libgnutls30:amd64 (3.5.8-5+deb9u3) ...
Selecting previously unselected package libkeyutils1:amd64.
Preparing to unpack .../18-libkeyutils1_1.5.9-9_amd64.deb ...
Unpacking libkeyutils1:amd64 (1.5.9-9) ...
Selecting previously unselected package libkrb5support0:amd64.
Preparing to unpack .../19-libkrb5support0_1.15-1+deb9u1_amd64.deb ...
Unpacking libkrb5support0:amd64 (1.15-1+deb9u1) ...
Selecting previously unselected package libk5crypto3:amd64.
Preparing to unpack .../20-libk5crypto3_1.15-1+deb9u1_amd64.deb ...
Unpacking libk5crypto3:amd64 (1.15-1+deb9u1) ...
Selecting previously unselected package libkrb5-3:amd64.
Preparing to unpack .../21-libkrb5-3_1.15-1+deb9u1_amd64.deb ...
Unpacking libkrb5-3:amd64 (1.15-1+deb9u1) ...
Selecting previously unselected package libgssapi-krb5-2:amd64.
Preparing to unpack .../22-libgssapi-krb5-2_1.15-1+deb9u1_amd64.deb ...
Unpacking libgssapi-krb5-2:amd64 (1.15-1+deb9u1) ...
Selecting previously unselected package libsasl2-modules-db:amd64.
Preparing to unpack .../23-libsasl2-modules-db_2.1.27~101-g0780600+dfsg-3_amd64.deb ...
Unpacking libsasl2-modules-db:amd64 (2.1.27~101-g0780600+dfsg-3) ...
Selecting previously unselected package libsasl2-2:amd64.
Preparing to unpack .../24-libsasl2-2_2.1.27~101-g0780600+dfsg-3_amd64.deb ...
Unpacking libsasl2-2:amd64 (2.1.27~101-g0780600+dfsg-3) ...
Selecting previously unselected package libldap-common.
Preparing to unpack .../25-libldap-common_2.4.44+dfsg-5+deb9u1_all.deb ...
Unpacking libldap-common (2.4.44+dfsg-5+deb9u1) ...
Selecting previously unselected package libldap-2.4-2:amd64.
Preparing to unpack .../26-libldap-2.4-2_2.4.44+dfsg-5+deb9u1_amd64.deb ...
Unpacking libldap-2.4-2:amd64 (2.4.44+dfsg-5+deb9u1) ...
Selecting previously unselected package xz-utils.
Preparing to unpack .../27-xz-utils_5.2.2-1.2+b1_amd64.deb ...
Unpacking xz-utils (5.2.2-1.2+b1) ...
Selecting previously unselected package libunistring0:amd64.
Preparing to unpack .../28-libunistring0_0.9.6+really0.9.3-0.1_amd64.deb ...
Unpacking libunistring0:amd64 (0.9.6+really0.9.3-0.1) ...
Selecting previously unselected package libidn2-0:amd64.
Preparing to unpack .../29-libidn2-0_0.16-1+deb9u1_amd64.deb ...
Unpacking libidn2-0:amd64 (0.16-1+deb9u1) ...
Selecting previously unselected package libnghttp2-14:amd64.
Preparing to unpack .../30-libnghttp2-14_1.18.1-1_amd64.deb ...
Unpacking libnghttp2-14:amd64 (1.18.1-1) ...
Selecting previously unselected package libpsl5:amd64.
Preparing to unpack .../31-libpsl5_0.17.0-3_amd64.deb ...
Unpacking libpsl5:amd64 (0.17.0-3) ...
Selecting previously unselected package librtmp1:amd64.
Preparing to unpack .../32-librtmp1_2.4+20151223.gitfa8646d.1-1+b1_amd64.deb ...
Unpacking librtmp1:amd64 (2.4+20151223.gitfa8646d.1-1+b1) ...
Selecting previously unselected package libssh2-1:amd64.
Preparing to unpack .../33-libssh2-1_1.7.0-1_amd64.deb ...
Unpacking libssh2-1:amd64 (1.7.0-1) ...
Selecting previously unselected package libcurl3-gnutls:amd64.
Preparing to unpack .../34-libcurl3-gnutls_7.52.1-5+deb9u4_amd64.deb ...
Unpacking libcurl3-gnutls:amd64 (7.52.1-5+deb9u4) ...
Selecting previously unselected package apt-transport-https.
Preparing to unpack .../35-apt-transport-https_1.4.8_amd64.deb ...
Unpacking apt-transport-https (1.4.8) ...
Selecting previously unselected package openssl.
Preparing to unpack .../36-openssl_1.1.0f-3+deb9u1_amd64.deb ...
Unpacking openssl (1.1.0f-3+deb9u1) ...
Selecting previously unselected package ca-certificates.
Preparing to unpack .../37-ca-certificates_20161130+nmu1_all.deb ...
Unpacking ca-certificates (20161130+nmu1) ...
Selecting previously unselected package libcurl3:amd64.
Preparing to unpack .../38-libcurl3_7.52.1-5+deb9u4_amd64.deb ...
Unpacking libcurl3:amd64 (7.52.1-5+deb9u4) ...
Selecting previously unselected package curl.
Preparing to unpack .../39-curl_7.52.1-5+deb9u4_amd64.deb ...
Unpacking curl (7.52.1-5+deb9u4) ...
Selecting previously unselected package libsasl2-modules:amd64.
Preparing to unpack .../40-libsasl2-modules_2.1.27~101-g0780600+dfsg-3_amd64.deb ...
Unpacking libsasl2-modules:amd64 (2.1.27~101-g0780600+dfsg-3) ...
Selecting previously unselected package psmisc.
Preparing to unpack .../41-psmisc_22.21-2.1+b2_amd64.deb ...
Unpacking psmisc (22.21-2.1+b2) ...
Selecting previously unselected package gnupg1.
Preparing to unpack .../42-gnupg1_1.4.21-4_amd64.deb ...
Unpacking gnupg1 (1.4.21-4) ...
Selecting previously unselected package gnupg1-curl.
Preparing to unpack .../43-gnupg1-curl_1.4.21-4_amd64.deb ...
Adding 'diversion of /usr/lib/gnupg1/gpgkeys_curl to /usr/lib/gnupg1/gpgkeys_curl.non_curl by gnupg1-curl'
Adding 'diversion of /usr/lib/gnupg1/gpgkeys_hkp to /usr/lib/gnupg1/gpgkeys_hkp.non_curl by gnupg1-curl'
Unpacking gnupg1-curl (1.4.21-4) ...
Selecting previously unselected package gnupg1-l10n.
Preparing to unpack .../44-gnupg1-l10n_1.4.21-4_all.deb ...
Unpacking gnupg1-l10n (1.4.21-4) ...
Selecting previously unselected package publicsuffix.
Preparing to unpack .../45-publicsuffix_20171028.2055-0+deb9u1_all.deb ...
Unpacking publicsuffix (20171028.2055-0+deb9u1) ...
Setting up readline-common (7.0-3) ...
Setting up libapt-inst2.0:amd64 (1.4.8) ...
Setting up libnettle6:amd64 (3.3-1+b2) ...
Setting up psmisc (22.21-2.1+b2) ...
Setting up libnghttp2-14:amd64 (1.18.1-1) ...
Setting up mime-support (3.60) ...
Setting up libldap-common (2.4.44+dfsg-5+deb9u1) ...
Setting up apt-utils (1.4.8) ...
Setting up libreadline7:amd64 (7.0-3) ...
Setting up libsasl2-modules-db:amd64 (2.1.27~101-g0780600+dfsg-3) ...
Setting up libsasl2-2:amd64 (2.1.27~101-g0780600+dfsg-3) ...
Setting up gnupg1 (1.4.21-4) ...
Setting up gnupg1-l10n (1.4.21-4) ...
Setting up libprocps6:amd64 (2:3.3.12-3) ...
Setting up libtasn1-6:amd64 (4.10-1.1+deb9u1) ...
Setting up libmagic-mgc (1:5.30-1+deb9u1) ...
Setting up bzip2 (1.0.6-8.1) ...
Setting up libmagic1:amd64 (1:5.30-1+deb9u1) ...
Setting up procps (2:3.3.12-3) ...
update-alternatives: using /usr/bin/w.procps to provide /usr/bin/w (w) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/w.1.gz because associated file /usr/share/man/man1/w.procps.1.gz (of link group w) doesn't exist
Setting up libssl1.0.2:amd64 (1.0.2l-2+deb9u2) ...
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.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libgmp10:amd64 (2:6.1.2+dfsg-1) ...
Setting up libssh2-1:amd64 (1.7.0-1) ...
Setting up krb5-locales (1.15-1+deb9u1) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Setting up publicsuffix (20171028.2055-0+deb9u1) ...
Setting up libunistring0:amd64 (0.9.6+really0.9.3-0.1) ...
Setting up xz-utils (5.2.2-1.2+b1) ...
update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/lzma.1.gz because associated file /usr/share/man/man1/xz.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/unlzma.1.gz because associated file /usr/share/man/man1/unxz.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzcat.1.gz because associated file /usr/share/man/man1/xzcat.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzmore.1.gz because associated file /usr/share/man/man1/xzmore.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzless.1.gz because associated file /usr/share/man/man1/xzless.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzdiff.1.gz because associated file /usr/share/man/man1/xzdiff.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzcmp.1.gz because associated file /usr/share/man/man1/xzcmp.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzgrep.1.gz because associated file /usr/share/man/man1/xzgrep.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzegrep.1.gz because associated file /usr/share/man/man1/xzegrep.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzfgrep.1.gz because associated file /usr/share/man/man1/xzfgrep.1.gz (of link group lzma) doesn't exist
Setting up openssl (1.1.0f-3+deb9u1) ...
Setting up libsqlite3-0:amd64 (3.16.2-5+deb9u1) ...
Setting up libffi6:amd64 (3.2.1-6) ...
Setting up libkeyutils1:amd64 (1.5.9-9) ...
Setting up libsasl2-modules:amd64 (2.1.27~101-g0780600+dfsg-3) ...
Setting up ca-certificates (20161130+nmu1) ...
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.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Updating certificates in /etc/ssl/certs...
166 added, 0 removed; done.
Setting up libpython2.7-stdlib:amd64 (2.7.13-2+deb9u2) ...
Setting up libidn11:amd64 (1.33-1) ...
Setting up libidn2-0:amd64 (0.16-1+deb9u1) ...
Setting up libpsl5:amd64 (0.17.0-3) ...
Setting up python2.7 (2.7.13-2+deb9u2) ...
Setting up file (1:5.30-1+deb9u1) ...
Setting up libkrb5support0:amd64 (1.15-1+deb9u1) ...
Setting up libhogweed4:amd64 (3.3-1+b2) ...
Setting up libpython-stdlib:amd64 (2.7.13-2) ...
Setting up libp11-kit0:amd64 (0.23.3-2) ...
Setting up python (2.7.13-2) ...
Setting up libk5crypto3:amd64 (1.15-1+deb9u1) ...
Setting up libgnutls30:amd64 (3.5.8-5+deb9u3) ...
Setting up librtmp1:amd64 (2.4+20151223.gitfa8646d.1-1+b1) ...
Setting up libldap-2.4-2:amd64 (2.4.44+dfsg-5+deb9u1) ...
Setting up libkrb5-3:amd64 (1.15-1+deb9u1) ...
Setting up libgssapi-krb5-2:amd64 (1.15-1+deb9u1) ...
Setting up libcurl3:amd64 (7.52.1-5+deb9u4) ...
Setting up libcurl3-gnutls:amd64 (7.52.1-5+deb9u4) ...
Setting up gnupg1-curl (1.4.21-4) ...
Setting up apt-transport-https (1.4.8) ...
Setting up curl (7.52.1-5+deb9u4) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Processing triggers for ca-certificates (20161130+nmu1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
The command '/bin/sh -c apt-get update     && apt-get install -qqy curl python apt-transport-https apt-utils gnupg1 procps     && echo 'deb https://packages.amplify.nginx.com/debian/ stretch amplify-agent' > /etc/apt/sources.list.d/nginx-amplify.list     && curl -fs https://nginx.org/keys/nginx_signing.key | apt-key add - > /dev/null 2>&1     && apt-get update     && apt-get install -qqy nginx-amplify-agent     && apt-get purge -qqy curl apt-transport-https apt-utils gnupg1     && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 2
JanC commented

It looks like /var/lib/apt/lists/ does not exist so && rm -rf /var/lib/apt/lists/* fails

Works fine here with Docker CE Version 17.12.0-ce-mac47 (21805), which version do you run?

Anyway try running docker run -ti --rm nginx:1.13, and input all &&-separated commands manually to find out what the issue there is.

@JanC what was the culprit?

JanC commented

I have no idea :/
I tried docker run -ti --rm nginx:1.13 even before you suggested it but it did not help

It was constantly failing but it's not anymore. If I can reproduce it again, I'll debug more and report back