我正在尝试解决这个网络问题,我在执行任何Docker命令,如"Docker搜索Ubuntu"时多次面对.
我收到一个错误说:
"Error response from daemon: server misbehaving.
Run Code Online (Sandbox Code Playgroud)
谁可以帮我这个事?
我正在尝试为elasticsearch-curator构建一个Docker镜像,
这是dockerfile:
FROM alpine:3.7
RUN adduser -S curator
RUN apk add --update \
python \
python-dev \
py-pip \
build-base \
&& pip install virtualenv \
&& pip install elasticsearch-curator \
&& rm -rf /var/cache/apk/*
USER curator
ENTRYPOINT [ "/usr/bin/curator"]
Run Code Online (Sandbox Code Playgroud)
事情是我在代理下,所以我必须建立我的形象:
docker build --no-cache --build-arg HTTP_PROXY=http://xx.xx.xx.xx:xx -t elasticsearch-curator:5.4 .
Run Code Online (Sandbox Code Playgroud)
但是当它想要获得virtualenv时,我得到:
Collecting virtualenv
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb8259ed350>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/virtualenv/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection …Run Code Online (Sandbox Code Playgroud) 上下文: 操作系统:Windows 10 Pro;Docker 版本:18.09.0(构建 4d60db4);在企业代理的背后,使用CNTLM来解决这个问题。(目前正在拉/运行图像工作正常)
问题: 我试图构建以下 Dockerfile:
FROM alpine:3.5
RUN apk add --update \
python3
RUN pip3 install bottle
EXPOSE 8000
COPY main.py /main.py
CMD python3 /main.py
Run Code Online (Sandbox Code Playgroud)
这是我得到的:
Sending build context to Docker daemon 11.26kB
Step 1/6 : FROM alpine:3.5
---> dc496f71dbb5
Step 2/6 : RUN apk add --update python3
---> Running in 7f5099b20192
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.5/main: could not connect to server (check repositories file)
WARNING: Ignoring APKINDEX.c51f8f92.tar.gz: No such file or directory
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/community/x86_64/APKINDEX.tar.gz …Run Code Online (Sandbox Code Playgroud) 我在 docker build 期间遇到了 npm 问题。我支持公司代理,并阅读了大约 30 篇解决类似问题的文章(和 stackoverflow 帖子)。但是,我仍然无法克服这一点。
我能够“npm install”项目并在 docker 构建过程之外获取所有必要的依赖项(但也使用代理),但不能在此期间获取。
到目前为止我尝试过的:
npm config set strict-ssl=false \
npm config set registry=http://registry.npmjs.org/ \
将代理设置作为 --build-arg、env 并通过 RUN 参数传递
从一个干净的 git checkout(没有 node_modules)开始并在运行 npm install 之后
我正在尝试构建:
$ sudo docker build --build-arg HTTP_PROXY=http://127.0.0.1:3128 --build-arg HTTPS_PROXY=http://127.0.0.1:3128 .
Run Code Online (Sandbox Code Playgroud)
输出
Sending build context to Docker daemon 226.6 MB
Step 1 : FROM node:argon
---> c74c117ed521
Step 2 : ENV http_proxy http://127.0.0.1:3128/
---> Using …Run Code Online (Sandbox Code Playgroud)