当我运行 sudo docker-compose build 我得到
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 support.docker\n</body></html>\n\n"我需要为 docker-compose 设置代理以构建
I need to set proxy for docker-compose for build
我尝试过的事情:
查看 https ://docs.docker/network/proxy/#configure-the-docker-client
-
我尝试设置〜/ .docker / config.json
尝试过 --env 参数
尝试在服务器上设置代理变量,但没有结果
tried setting proxy variables on the server with no result
我也尝试过此链接
services: myservice: build: context: . args: - http_proxy - https_proxy - no_proxy但是我在 version上得到了这个:'3.6'
Unsupported config option for services.web: 'args'
这些设置似乎是在docker上设置的,而不是在docker-compose
these settings seem to be set on docker and not docker-compose
我也不需要在我的本地设备上设置任何代理(我不想
i also don't need to set any proxy on my local device (i don't want to loose portability if possible)
docker-compose version 1.23.1, build b02f1306 Docker version 18.06.1-ce, build e68fc7a推荐答案
您必须来自伊朗被docker禁止(来自 403 状态代码)。通过编辑``:
You must be from Iran which is banned by docker (from 403 status code). add http proxy env to you docker service by editing ``:
[Service] Environment = HTTP_PROXY = http:// proxy.example:80/ HTTPS_PROXY = http://proxy.example:80 /
之后,您应该发出:
$ systemctl daemon-reload $ systemctl restart docker更多推荐
在服务器上的docker
发布评论