Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile does not build on armel #45

Open
mhaas opened this issue Jan 7, 2018 · 4 comments
Open

Dockerfile does not build on armel #45

mhaas opened this issue Jan 7, 2018 · 4 comments

Comments

@mhaas
Copy link

mhaas commented Jan 7, 2018

Hi,

I just tried building the Dockerfile on my armel box. It fails to build with the following error:

 ---> 7424d653b82a
Step 4/8 : RUN pip --no-cache-dir install --upgrade pip
 ---> Running in 629f7e46aa78
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 7, in <module>
    from pip import main
  File "/usr/local/lib/python2.7/site-packages/pip/__init__.py", line 5, in <module>
    import logging
  File "/usr/local/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/local/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (

The likely reason is that the FROM image is python:2, which contains a python built from source. The apt-get invocation however installs python packages from Debian.

@mhaas
Copy link
Author

mhaas commented Jan 8, 2018

The following patch works for me:

mhaas@ivanov:~/dev/python-firetv$ git diff
diff --git a/Dockerfile b/Dockerfile
index b0b7598..e3fbb78 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,10 +1,12 @@
-FROM python:2
+FROM buildpack-deps:stretch
 MAINTAINER Jon Bullen
 
 RUN apt-get update && apt-get install -y \
         libssl-dev \
         libusb-1.0-0 \
+        python \
         python-dev \
+        python-pip \
         swig \
         curl \
         unzip \
@@ -17,7 +19,7 @@ RUN apt-get update && apt-get install -y \
 
 RUN pip --no-cache-dir install --upgrade pip
 RUN pip --no-cache-dir install flask
-RUN pip --no-cache-dir install https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.24.0.tar.gz
+RUN pip --no-cache-dir install https://pypi.python.org/packages/01/bd/a41491718f9e2bebab015c42b5be7071c6695acfa301e3fc0480bfd6a15b/M2Crypto-0.27.0.tar.gz
 RUN pip install /tmp/python-firetv-master[firetv-server]
 
 CMD ["firetv-server", "-c", "config/devices.yaml"]

The originally used python:2 image uses FROM buildpack-deps:jessie, so I just decided to use that for this Dockerfile as well. Note that I used stretch instead of jessie, which is why I had to update m2crypto to make it build. If I had used jessie, the originally used version should have worked.

@Aareon
Copy link
Contributor

Aareon commented Feb 8, 2018

@mhaas any way you can create a PR with the patch so long as it doesn't break anything else?

@mhaas
Copy link
Author

mhaas commented Feb 22, 2018

@Aareon I was just working on the PR, but I cannot run current master with the patch above due to commit 5de43fc

Does python-firetv now require python 3?

mhaas@ganymed:~/dev/python-firetv$ docker run python-firetv
Traceback (most recent call last):
  File "/usr/local/bin/firetv-server", line 7, in <module>
    from firetv.__main__ import main
  File "/usr/local/lib/python2.7/dist-packages/firetv/__main__.py", line 36
    def is_valid_host(host: str):
                          ^
SyntaxError: invalid syntax

@Aareon
Copy link
Contributor

Aareon commented Feb 22, 2018

odd. What version of Python are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants