Uh oh!
There was an error while loading. Please reload this page.
Allow Docker image build using HTTP proxy in corporate networks - #65361
Allow Docker image build using HTTP proxy in corporate networks#65361wolfdn wants to merge 1 commit into
Conversation
Uh oh!
There was an error while loading. Please reload this page.
potiuk
commented
Apr 16, 2026
Better solution would be to embed GPG key in the image. We can probably automate prek to rertrieve GPG Keys and hard-code them in the image. This is not only faster but more secure . Those keys don't change - once published and we are using their IDs, they won't change. |
jscheffl
commented
Apr 16, 2026
What do your mean with "embedding"? That the key is cloned in Airflow repo and COPY is made into docker or that wget is used in general to download? I mean the docker is anyway built dynamically... so what does "persist" mean? Git? |
wolfdn
commented
Apr 17, 2026
I like the idea - do you mean something like this? #65408 |
wolfdn
commented
Apr 20, 2026
Closing in favor of #65408 |
Problem
Building Airflow Docker images fails in environments where GPG's
dirmngrcannot reach keyservers — most commonly behind corporate HTTP proxies. This makes commands likebreeze start-airflowfail, if it is attempted to build a new Docker image - even if the Docker daemon and client have correct HTTP proxy configuration.The issue is that
dirmngr(GnuPG's network daemon, used forgpg --recv-keys) resolves DNS locally before connecting, even when--keyserver-options http-proxy=...is configured. In corporate networks where an intercepting DNS server returns NXDOMAIN for external domains (routing all internet access exclusively through an HTTP proxy),dirmngrfails withkeyserver receive failed: No keyserver availablebefore it ever attempts a connection.Tools like
wgetandcurlwork in these environments because they delegate DNS resolution to the proxy via theCONNECTmethod whenhttp_proxy/https_proxyenvironment variables are set.This affects two code paths:
install_os_dependencies.sh) — fetching the Python release manager's GPG key fromkeys.openpgp.orgwhen building Python 3.10 from source.common.sh→common::import_trusted_gpg) — fetching GPG keys for MariaDB, MySQL, PostgreSQL, and MSSQL APT repositories fromkeyserver.ubuntu.com/pgp.surf.nl.I'm not sure how many developers of Airflow it would help to fix this - so how many developers (are forced to) work behind a corporate HTTP proxy. At least for us it would be nice to have this fixed, because it would make setting up a development environment a bit more straightforward.
Proposed Solution
Add a
wgetfallback after eachgpg --recv-keyscall. If GPG fails to fetch the key natively, the same key is fetched via HTTPS usingwgetand imported withgpg --import. This keeps the existing GPG-native path as the primary method (no changes for environments without proxy issues) while providing a working fallback for proxy-constrained environments.Why the wget command differs between the two code paths
The fallback uses different URLs depending on the keyserver API:
keys.openpgp.org(Python key) uses the VKS API, which has a clean endpoint:The key fingerprint is used directly — no prefix manipulation needed.
keyserver.ubuntu.com/pgp.surf.nl(APT repo keys) use the HKP protocol's/pks/lookupendpoint:This requires:
hkps://orhkp://URL scheme0xprefix from the key ID (some callers pass a0xprefix for the key IDs, others don't) and re-adding it as a query parameter to avoid a double-0xbuggpg --list-keysbefore breaking out of the keyserver loop, becausegpg --importexits 0 even on empty inputChanges
scripts/docker/common.sh—common::import_trusted_gpg(): added wget fallback with HKP lookup aftergpg --recv-keysin the keyserver loopscripts/docker/install_os_dependencies.sh—install_python(): added wget fallback with VKS lookup aftergpg --recv-keysfor the Python GPG keyDockerfile.ci,Dockerfile— updated inlined copies of both scriptsWas generative AI tooling used to co-author this PR?
GitHub Copilot - Claude Opus 4.6
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.