1

I am trying to build a python application on freebsd11 and docker

i have installed docker as per https://wiki.freebsd.org/Docker and all seems to work fine.

my Dockerfile is like

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

any advise much appreciated.

  • I don't see anything on that wiki in regards to building, but it seems like your process fails due to some requirements, you should try to resolve it and then try it again... – alexus Aug 3 '15 at 13:56
  • the issue seems is that when i pass the DNS it is not being set when building so it cannot resolve the name in order to install the dependencies. So i am unsure if i need to configure the base jail and set the resolv.conf there, but where is this? – khinester Aug 3 '15 at 14:09
  • 1
    I've seen this as well, it looks like the changes in one step aren't carried over to the next. That is, the resolv.conf you write in the first step isn't available in the second. I've found that putting echo nameserver 8.8.8.8 > /etc/resolv.conf && before each step worked for me as an ugly workaround. – Lars Kotthoff Aug 7 '15 at 0:03
0

According to the wiki, Docker needs a patch to work:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227618#c6

I have not yet tested this, but others have had success with this method.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.