1
我有一個泊塢與被部署爲在Azure web應用蟒(I遵循這個教程:https://docs.microsoft.com/en-us/azure/app-service-web/app-service-web-tutorial-docker-python-postgresql-app)連接到Blob存儲從使用Python個人泊塢圖像部署爲天青的webapp
的Dockerfile看起來像這樣:
FROM python:3.6.1
EXPOSE 2222 80 8080 5000
COPY daemon.json /etc/docker/
ENV http_proxy http://<LOCALPROXYADDRESS>:8080
ENV https_proxy https://<LOCALPROXYADDRESS>:8080
RUN apt-get update \
&& apt-get install -y --no-install-recommends openssh-server \
&& echo "root:Docker!" | chpasswd
COPY requirements.txt/
RUN pip install -r ./requirements.txt
COPY sshd_config /etc/ssh/
COPY init_container.sh /bin/
RUN chmod 755 /bin/init_container.sh
CMD ["/bin/init_container.sh"]
COPY app/ /app/
WORKDIR /app
ENV FLASK_APP=app.py
CMD flask run -h 0.0.0.0 -p 5000
我嘗試通過python連接到使用來自azure.storage.blob的BlockBlobService的Blob存儲。這適用於在本地機器上啓動的容器。一旦我把它推到天藍,被印刷在以下錯誤:
azure.common.AzureException: HTTPSConnectionPool(host='<CONTAINERNAME>.blob.core.windows.net', port=443):
Max retries exceeded with url: /mycontainer?restype=container
(Caused by ProxyError('Cannot connect to proxy.',
NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at
0x7fe859467cc0>: Failed to establish a new connection: [Errno -2] Name or
service not known',)))
代理是否也在Azure上運行?我相信沒有代理可以在您的本地訪問,這就是爲什麼它不起作用。刪除'ENV http_proxy http://:8080'和'ENV https_proxy http:// :8080'。構建並推送應該工作的圖像 –