【发布时间】:2019-12-22 21:47:11
【问题描述】:
我在企业互联网上。我们只能使用某些端口/通过代理连接。
我正在尝试运行以下简单的 docker 命令:
docker build -t MY_USERNAME/myfirstapp .
我的 dockerfile 包含这个:
# our base image
FROM alpine:3.5
# Install python and pip
**RUN apk add --update py2-pip**
# install Python modules needed by the Python app
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt
# copy files required for the app to run
COPY app.py /usr/src/app/
COPY templates/index.html /usr/src/app/templates/
# tell the port number the container should expose
EXPOSE 5000
# run the application
CMD ["python", "/usr/src/app/app.py"]
它在RUN apk add --update py2-pip 上失败并出现错误
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: temporary error (try again later)
WARNING: Ignoring APKINDEX.c51f8f92.tar.gz: No such file or directory
我可以从 curl 这个地址中看出它可以工作,所以这一定是代理/端口问题。
如何在遵守端口/代理限制的情况下执行此操作?
非常感谢。
【问题讨论】:
标签: docker ubuntu ubuntu-16.04 alpine docker-build