当我跑步时sudo docker-compose build
i get
Building web
Step 1/8 : FROM python:3.7-alpine
ERROR: Service 'web' failed to build: error parsing HTTP 403 response body: invalid character '<' looking for beginning of value: "<html><body><h1>403 Forbidden</h1>\nSince Docker is a US company, we must comply with US export control regulations. In an effort to comply with these, we now block all IP addresses that are located in Cuba, Iran, North Korea, Republic of Crimea, Sudan, and Syria. If you are not in one of these cities, countries, or regions and are blocked, please reach out to https://support.docker.com\n</body></html>\n\n"
我需要设置代理docker-compose
用于构建
我尝试过的事情:
看着https://docs.docker.com/network/proxy/#configure-the-docker-client https://docs.docker.com/network/proxy/#configure-the-docker-client
-
我尝试过设置~/.docker/config.json
{
"proxies":
{
"default":
{
"httpProxy": "http://127.0.0.1:9278"
}
}
}
尝试过--env
争论
尝试在服务器上设置代理变量但没有结果
-
我也试过这个link https://stackoverflow.com/a/36084324/4626485
services:
myservice:
build:
context: .
args:
- http_proxy
- https_proxy
- no_proxy
但我穿上了version: '3.6'
Unsupported config option for services.web: 'args'
这些设置似乎是在 docker 上设置的,而不是在 docker-compose 上设置的
我也不需要在本地设备上设置任何代理(如果可能的话,我不想失去可移植性)
docker-compose version 1.23.1, build b02f1306
Docker version 18.06.1-ce, build e68fc7a