You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing this to document how I could use cibuildwheel behind a corporate proxy (at least in Gitlab).
I couldn't find any information in the docs about this, nor in the Github issues ou discussions.
Initially, I would get an HTTP 504 error (that was from my proxy). As I progressed with configuring this, I also got HTTP 502, and pip errors basically saying pip couldn't find packages.
Anyway, what I found is that I need to define the proxy environment variables and make sure they are passed to the container doing the build.
In particular, NO_PROXY must contain docker for the python container to be able to reach the dind container.
Also, I needed to implement docker-specific proxy configuration in .docker/config.json. I used CIBW_BEFORE_ALL for this.
# .gitlab-ci.ymlbuild-linux:
image: python:3.8# make a docker daemon available for cibuildwheel to useservices:
- name: docker:dindentrypoint: ["env", "-u", "DOCKER_HOST"]command: ["dockerd-entrypoint.sh"]variables:
DOCKER_HOST: tcp://docker:2375/DOCKER_DRIVER: overlay2# See https://github.com/docker-library/docker/pull/166DOCKER_TLS_CERTDIR: ""CIBW_BEFORE_ALL: > mkdir -p .docker && echo "{"proxies":{"default":{"httpProxy": "http://10.9.8.7:8080", "httpsProxy": "http://10.9.8.7:8080", noProxy: "localhost,127.0.0.0/8,docker"}}}" > .docker/config.jsonCIBW_ENVIRONMENT_PASS_LINUX: HTTP_PROXY HTTPS_PROXY NO_PROXYHTTP_PROXY: http://10.9.8.7:8080HTTPS_PROXY: http://10.9.8.7:8080NO_PROXY: localhost,127.0.0.0/8,dockerscript:
- curl -sSL https://get.docker.com/ | sh
- python -m pip install cibuildwheel==2.16.2
- cibuildwheel --output-dir wheelhouseartifacts:
paths:
- wheelhouse/
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am writing this to document how I could use cibuildwheel behind a corporate proxy (at least in Gitlab).
I couldn't find any information in the docs about this, nor in the Github issues ou discussions.
Initially, I would get an HTTP 504 error (that was from my proxy). As I progressed with configuring this, I also got HTTP 502, and pip errors basically saying pip couldn't find packages.
Anyway, what I found is that I need to define the proxy environment variables and make sure they are passed to the container doing the build.
In particular,
NO_PROXY
must containdocker
for the python container to be able to reach the dind container.Also, I needed to implement docker-specific proxy configuration in
.docker/config.json
. I usedCIBW_BEFORE_ALL
for this.Beta Was this translation helpful? Give feedback.
All reactions