-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guidance on GPG best practices #4252
Comments
TLDR; GPG servers are extremely flaky and we have yet to solve it reliably. For automated testing, we usually just set our travis builds to repeat multiple times (like php) since it is usually just gpg failures. For builds on my local machine (which is were most build tests for official image PRs are done) I run an nginx reverse proxy server to man-in-the-middle apt, apk, and gpg requests and cache them. For the servers that build and push the official images we take an eventually consistent approach and mark builds as "unstable" if one or more tags fail to build and just allow the build to run later. They also have multiple retries for each tag. Related issues: docker-library/cassandra#131 (comment), docker-library/tomcat#87, docker-library/tomcat#108, docker-library/mysql#263 (comment), docker-library/httpd#66 (comment), docker-library/php#586, docker-library/wordpress#291 |
Since it seems that sks-keyserver cause a lot of trouble around the docker world [1], we remove the need to rely on them and import the key directly instead. As we use the fingerprint to import it, why not simply use the whole key? [1]: docker-library/official-images#4252 (comment) Signed-off-by: Sheogorath <[email protected]>
Add Mesos GPG key since accessing the keyserver seems to be flaky: docker-library/official-images#4252 (comment)
With the node image, we had a lot of issues with the GPG servers, particularly when building under Alpine. We ended up with the following gpg servers which seem to be working well:
We ended up dropping keyserver.pgp.com entirely. |
Add Mesos GPG key since accessing the keyserver seems to be flaky: docker-library/official-images#4252 (comment)
New initiative is to just use one gpg server and then use a proxy for travis builds (and now on the official build servers!). Example here: docker-library/php#666. |
* Use https to retrieve archive from Rakudo server * Retrieve PGP signature from Rakudo server (https) * Retrieve PGP public key over hkps and using full fingerprint * Verify archive using signature (explicitly with gpg2)
* Update tini to v0.18.0 (current latest release) * Add gpg recv-keys retry loop per docker-library#4252 * Switch to tini-static instead of dynamic build for compatibility with alpine * Use tini --version instead of tini --help which is not available in TINI_MINIMAL releases.
* Update tini to v0.18.0 (current latest release) * Add gpg recv-keys retry loop per docker-library#4252 * Switch to tini-static instead of dynamic build for automatic compatibility with alpine * Use tini --version instead of tini --help which is not available in TINI_MINIMAL releases Snippet tested on: * Ubuntu 12.04 to 18.04 * Debian * Alpine
Forgive me for asking, but has there been any consideration as to why it's de-facto to import keys one at a time, instead of wadding them together in one large bulk request to each keyserver? For projects that have three or more keys to import, I would wager this is not helping the reliability of the keyservers. Perhaps a better solution is in order? |
|
I don't know a ton about the GPG ecosystem, but couldn't Docker run some sort of proxy or mirror for this purpose? Like, if the main place it's a PITA is building Docker images, maybe just we point our keyserver addresses to a Docker mirror? |
Well you can run a proxy in a Docker container for handling gpg requests, as we do when building the images #4252 (comment) |
Indeed, as @wglambert has pointed out, this is exactly how we solve this problem on all our Travis builds and our official build infrastructure today: https://github.com/tianon/pgp-happy-eyeballs There's a script there called " install:
- wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash |
Just to thread the needle all the way through: https://github.com/docker-library/faq#openpgp--gnupg-keys-and-verification |
Use multiple gpg key server as seen here: docker-library/official-images#4252 Signed-off-by: Alexander Trost <[email protected]>
I currently maintain the InfluxData images for chronograf, kapacitor, influxdb, and telegraf. When we release a new version, we go through a process where all of these images get built usually multiple times before a pull request is eventually created.
Unfortunately, we keep running into an issue with the GPG keys and I'm not sure what to do. It usually delays the upload by about a day while I wait for the GPG keyservers to sort themselves out.
We use the following run line in every image to retrieve the GPG key and we will usually get this at least once during our regular build:
Do you have any advice or best practices for GPG keys? Whatever we are doing, it isn't working well for us. I've seen some reports on issues that switching to an ipv4-only GPG keyserver works, but I also found another comment here that says it's a red herring and doesn't really help.
Thanks for any help.
The text was updated successfully, but these errors were encountered: