I am trying to run a docker build on an existing project.
I am getting this error on one of my steps
Step 3/18 : RUN set -ex && for key in 9554F04D7259F04124DE6B476D5A82AC7E37093B 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 FD3A5288F042B6850C66B31F09FE44734EB7990E 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 DD8F2338BAE7501E3DD5AC78C273792F7D83545D B9AE9905FFD7803F25714661B63B535A4C206CA9 C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 56730D5401028683275BD23C23EFEFE93C4CFFFE ; do gpg --keyserver pgp.mit.edu --recv-keys "$key" || gpg --keyserver keyserver.pgp.com --recv-keys "$key" || gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; done
---> Running in 9e13560f6a4c
+ gpg --keyserver pgp.mit.edu --recv-keys 9554F04D7259F04124DE6B476D5A82AC7E37093B
gpg: directory `/root/.gnupg' created
gpg: new configuration file `/root/.gnupg/gpg.conf' created
gpg: WARNING: options in `/root/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: requesting key 7E37093B from hkp server pgp.mit.edu
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 7E37093B: public key "Christopher Dickinson <christopher.s.dickinson#gmail.com>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
+ gpg --keyserver pgp.mit.edu --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5
gpg: requesting key DBE9B9C5 from hkp server pgp.mit.edu
?: pgp.mit.edu: Host not found
gpgkeys: HTTP fetch error 7: couldn't connect: Success
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
+ gpg --keyserver keyserver.pgp.com --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5
gpg: requesting key DBE9B9C5 from hkp server keyserver.pgp.com
?: keyserver.pgp.com: Host not found
gpgkeys: HTTP fetch error 7: couldn't connect: Success
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5
gpg: requesting key DBE9B9C5 from hkp server ha.pool.sks-keyservers.net
?: ha.pool.sks-keyservers.net: Host not found
gpgkeys: HTTP fetch error 7: couldn't connect: Success
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
Service 'dr-watson' failed to build: The command '/bin/sh -c set -ex && for key in 9554F04D7259F04124DE6B476D5A82AC7E37093B 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 FD3A5288F042B6850C66B31F09FE44734EB7990E 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 DD8F2338BAE7501E3DD5AC78C273792F7D83545D B9AE9905FFD7803F25714661B63B535A4C206CA9 C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 56730D5401028683275BD23C23EFEFE93C4CFFFE ; do gpg --keyserver pgp.mit.edu --recv-keys "$key" || gpg --keyserver keyserver.pgp.com --recv-keys "$key" || gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; done' returned a non-zero code: 2
Does anyone know how to resolve this?
Thanks
Damien
I updated the servers as per github dockerfile template and this resolved the issue.
Related
i am new in docker, when i run the command docker-compose up i am getting below error in that
+ gpg --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3
gpg: directory `/root/.gnupg' created
gpg: new configuration file `/root/.gnupg/gpg.conf' created
gpg: WARNING: options in `/root/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: requesting key 33CFC8B3 from hkp server ha.pool.sks-keyservers.net
?: ha.pool.sks-keyservers.net: Host not found
gpgkeys: HTTP fetch error 7: couldn't connect: Connection timed out
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
ERROR: Service 'php' failed to build: The command '/bin/sh -c set -xe && for key in $GPG_KEYS; do gpg --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys "$key"; done' returned a non-zero code: 2
here i have attached my docker yml file, can anyone please help me how to resolve this issue ?
application:
build: misc/docker/code
volumes:
- .:/var/www/seagull
tty: true
db:
image: mysql:5.6
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: toor
redis:
image: redis
ports:
- 6379:6379
php:
build: misc/docker/php-fpm/5.6
expose:
- "9000"
volumes_from:
- application
links:
- db
- redis
environment:
- REDIS_BACKEND=redis:6379
nginx:
build: misc/docker/nginx
ports:
- 80:80
links:
- php
volumes_from:
- application
volumes:
- ./var/log/nginx:/var/log/nginx
Keyserver issues are unfortunately very common -- Try a number of different methods, and the only method that's reasonably successful at combating the issue on a large scale is trying multiple keyservers in a loop until one succeeds. Usually, just re-starting the failing build is enough to get it to work, but there may be firewalls, etc in place that force a keyserver switch (keyserver.ubuntu.com is a good one that supports port 80 and is commonly allowed).
#ptsiampas Solved by getting it from multiple servers..
key='B42F6819007F00F88E364FD4036A9C25BF357DD4'; \
gpg --yes --always-trust --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --yes --always-trust --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --yes --always-trust --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
#camilo0365 Solved it in this way.
for server in ha.pool.sks-keyservers.net \
hkp://p80.pool.sks-keyservers.net:80 \
keyserver.ubuntu.com \
hkp://keyserver.ubuntu.com:80 \
pgp.mit.edu; do
gpg --keyserver "$server" --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && break || echo "Trying new server..."
done
you can use proxy, to solve your problem.
gpg --keyserver-options http-proxy="http://XXXXXXX"
--keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
Also for
ERROR: Service 'php' failed to build:
try docker-compose build --no-cache php-fpm
I'm trying to build a docker image with given dockerfiles: https://github.com/31z4/storm-docker/blob/4c2804fa4365f62c3b6009d3496661542e4d446a/2.2.0/Dockerfile
But docker build command occurs an error as below:
gpg --keyserver ha.pool.sks-keyservers.net --recv-key 79B03D059E628478FC9F1D8B152CAD0C46E87B61 gpg: keybox
'/tmp/tmp.r0rdSZG7mG/pubring.kbx' created gpg: keyserver receive
failed: Connection timed out
gpg --keyserver pgp.mit.edu --recv-keys 79B03D059E628478FC9F1D8B152CAD0C46E87B61 gpg: keyserver receive
failed: Connection timed out
gpg --keyserver keyserver.pgp.com --recv-keys 79B03D059E628478FC9F1D8B152CAD0C46E87B61 gpg: keyserver receive
failed: Connection timed out
I'm not familiar to gpg keyserver, but it seems that some keyserver addresses are exchangeable.
Can I find another gpg keyserver that can replace the existing keyservers?
I wrote a bash script that allows you to check upon multiple sources:
https://github.com/duxsco/gpg-config-and-scripts#pull-public-keys
You could also do:
gpg --auto-key-locate clear,dane,wkd,pka,cert,hkps://keys.openpgp.org,hkps://keys.mailvelope.com,hkps://keys.gentoo.org,hkps://keyserver.ubuntu.com --locate-external-keys <KeyID>
I am trying to install rvm in my Ubuntu 18.04.2 LTS and am getting error while installing gpg keys.
Command:
gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
Error:
gpg: connecting dirmngr at '/run/user/1000/gnupg/S.dirmngr' failed: IPC connect call failed
gpg: keyserver receive failed: No dirmngr
dirmngr is installed.
You can run the same key using Sudo Command I am Sure the run and perfectly wrok
sudo apt-key adv --recv-keys --keyserver hkp://p80.pool.sks-keyservers.net:80 7638D0442B90D010
This is a snippet of a Dockerfile that is exhibiting an error that I don't understand:
FROM dorowu/ubuntu-desktop-lxde-vnc
LABEL maintainer "bpinaya#wpi.edu"
# Adding keys for ROS
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
RUN apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
Gives this result
RUN apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
---> Running in 7bb30729ec87
Warning: apt-key output should not be parsed (stdout is not a terminal)
Executing: /tmp/apt-key-gpghome.HkofyyhjvI/gpg.1.sh --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
gpg: connecting dirmngr at '/tmp/apt-key-gpghome.HkofyyhjvI/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr
The command '/bin/sh -c apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116' returned a non-zero code: 2
According to this post here, you need to install dirmngr. I also needed to install gnupg in order to get this to work on my local docker container when testing.
I updated your Dockerfile code below with my changes:
FROM dorowu/ubuntu-desktop-lxde-vnc
LABEL maintainer "bpinaya#wpi.edu"
# Update
RUN apt-get update && \
apt-get upgrade -y
# Install required packages
RUN apt-get install -y \
dirmngr \
gnupg
# Adding keys for ROS
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
RUN apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
This gave me the following output on the last step:
Step 6/6 : RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
---> Running in a0cfb3588173
Warning: apt-key output should not be parsed (stdout is not a terminal)
Executing: /tmp/apt-key-gpghome.USze27holj/gpg.1.sh --keyserver hkp://pgp.mit.edu:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
gpg: key 5523BAEEB01FA116: public key "ROS Builder <rosbuild#ros.org>" imported
gpg: Total number processed: 1
gpg: imported: 1
Occasionally this reports back with the following error:
gpg: keyserver receive failed: Cannot assign requested address
That error doesn't seem consistent though, so it could be something with my own network connection.
I wanted to comment but don't have enough reputation to. Please consider my answer as an appendix to #brian-elliott 's answer. Dirmngr seems to have some strange default setup to use tor or some non-standard DNS. So make sure you have something like this:
standard-resolver
keyserver keyserver.ubuntu.com
keyserver keys.gnupg.net
in your ~/.gnupg/dirmngr.conf
I am following the instructions for installing Yarn on CircleCI, but CircleCI is showing these errors when trying to check the key server:
sudo apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.j5q2IRFiKK --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d//apt.postgresql.org.gpg --keyserver pgp.mit.edu --recv D101F7899D41F3C3
gpg: requesting key 9D41F3C3 from hkp server pgp.mit.edu
gpgkeys: key D101F7899D41F3C3 not found on keyserver
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
sudo apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3 returned exit code 2
Action failed: sudo apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3
The error message means that GPG couldn't load the public GPG key used to verify the package signatures. Try doing this instead:
sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg
The issue is that the pgp.mit.edu keyserver sometimes has outages, which results in the error message you're seeing. Loading the GPG key via URL should be more reliable.