Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

docker build returned a non-zero code: 2 #115

Closed
stevenlee87 opened this issue Feb 15, 2019 · 3 comments
Closed

docker build returned a non-zero code: 2 #115

stevenlee87 opened this issue Feb 15, 2019 · 3 comments

Comments

@stevenlee87
Copy link

hello!
when I execute docker build , returned a non-zero code: 2

that's my environment:
OS : CentOS Linux release 7.2.1511 (Core)
docker Version: 1.13
dockerfile and docker-entrypoint.sh down from https://github.com/hashicorp/docker-consul/blob/9bd2aa7ecf2414b8712e055f2374699148e8941c/0.X/Dockerfile

that's error:

  • gpg --keyserver pgp.mit.edu --recv-keys 91A6E7F85D05C65630BEF18951852D87348FFC4C
    gpg: directory '/root/.gnupg' created
    gpg: keybox '/root/.gnupg/pubring.kbx' created
    gpg: keyserver receive failed: No data
    The command '/bin/sh -c set -eux && apk add --no-cache ca-certificates curl dumb-init gnupg libcap openssl su-exec iputils jq && gpg --keyserver pgp.mit.edu --recv-keys 91A6E7F85D05C65630BEF18951852D87348FFC4C && mkdir -p /tmp/build && cd /tmp/build && apkArch="$(apk --print-arch)" && case "${apkArch}" in aarch64) consulArch='arm64' ;; armhf) consulArch='arm' ;; x86) consulArch='386' ;; x86_64) consulArch='amd64' ;; *) echo >&2 "error: unsupported architecture: ${apkArch} (see ${HASHICORP_RELEASES}/consul/${CONSUL_VERSION}/)" && exit 1 ;; esac && wget ${HASHICORP_RELEASES}/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}linux${consulArch}.zip && wget ${HASHICORP_RELEASES}/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}SHA256SUMS && wget ${HASHICORP_RELEASES}/consul/${CONSUL_VERSION}/consul${CONSUL_VERSION}SHA256SUMS.sig && gpg --batch --verify consul${CONSUL_VERSION}SHA256SUMS.sig consul${CONSUL_VERSION}SHA256SUMS && grep consul${CONSUL_VERSION}linux${consulArch}.zip consul_${CONSUL_VERSION}SHA256SUMS | sha256sum -c && unzip -d /bin consul${CONSUL_VERSION}linux${consulArch}.zip && cd /tmp && rm -rf /tmp/build && apk del gnupg openssl && rm -rf /root/.gnupg && consul version' returned a non-zero code: 2
@mkeeler
Copy link
Member

mkeeler commented Feb 15, 2019

Unfortunately this a transient error outside of our control (except if we just disabled gpg signature verification which we don't want to do). The error is communicating with pgp.mit.edu's gpg key server. Occasionally it fails to respond with the appropriate data. If you try the build again it should work.

@stevenlee87
Copy link
Author

I have removed the GPG function. thank you!

@jwalzer
Copy link

jwalzer commented Sep 21, 2020

Have a look at #137 - Duplicate.... and BTW, there is a PR to fix that

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants