我正在尝试在 freebsd11 和 docker 上构建一个 python 应用程序
我已经按照以下方式安装了dockerhttps://wiki.freebsd.org/Docker一切似乎都运行良好。
我的 Dockerfile 就像
FROM python:2-slim
CMD "sh" "-c" "echo nameserver 8.8.8.8 > /etc/resolv.conf"
COPY euvat-2.2.zip /euvat-2.2.zip
RUN pip install /euvat-2.2.zip
EXPOSE 3000
CMD ["euvat","--port=3000"]
$ docker build -t euvat .
Sending build context to Docker daemon 24.58 kB
Sending build context to Docker daemon
Step 0 : FROM python:2
---> e1857ee1f3b5
Step 1 : CMD "sh" "-c" "echo nameserver 8.8.8.8 > /etc/resolv.conf"
---> Using cache
---> 2d9ada7dbd60
Step 2 : COPY euvat-2.2.zip /euvat-2.2.zip
---> Using cache
---> a6249d4e4e11
Step 3 : RUN pip install /euvat-2.2.zip
---> Running in e3f17f197ada
Processing /euvat-2.2.zip
Collecting tornado>=3.1.1 (from euvat==2.2)
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /simple/tornado/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /simple/tornado/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /simple/tornado/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /simple/tornado/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /simple/tornado/
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /simple/tornado/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /simple/tornado/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /simple/tornado/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /simple/tornado/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-2, 'Name or service not known'))': /simple/tornado/
Could not find a version that satisfies the requirement tornado>=3.1.1 (from euvat==2.2) (from versions: )
No matching distribution found for tornado>=3.1.1 (from euvat==2.2)
jail: /bin/sh -c pip install /euvat-2.2.zip: failed
任何建议都非常感谢。
答案1
根据 wiki,Docker 需要补丁才能运行:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227618#c6
我还没有测试过,但其他人已经成功使用此方法。