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 build fails #203

Closed
bassebaba opened this issue Nov 11, 2018 · 4 comments
Closed

Dockerfile build fails #203

bassebaba opened this issue Nov 11, 2018 · 4 comments

Comments

@bassebaba
Copy link

Where are you using pytradfri (eg stand-alone, Home Assistant etc)

Stand alone, trying to build docker image

Version of pytradfri

5b360e9

Expected behaviour

Docker build succeeds

Actual behaviour

Step 9/12 : RUN python3 -m pip install -r requirements.txt
---> Running in 9ecc64ba5da9
Collecting aiocoap==0.4a1 (from -r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/19/7e/a407d251bb570b903b162f454760992a3c59cc1b81fe9a087e8cb4cc9eb8/aiocoap-0.4a1.tar.gz (115kB)
aiocoap requires Python '>=3.4.4' but the running Python is 3.4.2
The command '/bin/sh -c python3 -m pip install -r requirements.txt' returned a non-zero code: 1

@ggravlingen
Copy link
Member

What version of Python are you running on your device?

@bassebaba
Copy link
Author

bassebaba commented Nov 11, 2018

I'm trying to create the docker image.

Dockerfile uses debian:latest:
FROM debian:latest

$ docker run -it --rm  debian:latest

root@f865c8a58e1b:/# apt-cache show python3
Package: python3
Source: python3-defaults
Version: 3.4.2-2

root@f865c8a58e1b:/# cat /etc/issue
Debian GNU/Linux 8 \n \l

It seems like the python3 package in Debian 8 is version 3.4.2-2.
https://packages.debian.org/jessie/python3

The Dockerfile does install "python3":

RUN apt-get update -y && \
  apt-get install -y python3 ....

So what we get in the Docker image is 3.4.2...

I ugly-hacked it by reverting to "aiocoap==0.3" in the requirements.txt and it seem to compile & work with some fast testing. (No idea if this will work 100%)

In order to install a higher version in the docker image I guess one needs to either add more sources to the apt or manually build python.

@ggravlingen
Copy link
Member

Do you know how to upgrade Python in the docker image? If so, please feel free to submit a PR to resolve this issue.

alex3305 pushed a commit to alex3305/pytradfri that referenced this issue Nov 18, 2018
This resolves issue home-assistant-libs#203 and also optimizes the Dockerfile to use less
resources. Also the current version from the Git repo is copied to
the Docker container for easy access.

I've taken the liberty to also update the DTLSSocket requirement to
version 0.1.7 which resolves an issue regarding cython. According to
their repo, nothing else has changed [1].

The RPi and RPiW Dockerfiles were not updated because of compatibility
reasons. I cannot easily test those files and do not want to break
anything.

**References**

 1. https://git.fslab.de/jkonra2m/tinydtls-cython/commits/master
alex3305 pushed a commit to alex3305/pytradfri that referenced this issue Nov 18, 2018
This resolves issue home-assistant-libs#203 and also optimizes the Dockerfile to use less
resources. Also the current version from the Git repo is copied to
the Docker container for easy access.

I've taken the liberty to also update the DTLSSocket requirement to
version 0.1.7 which resolves an issue regarding cython. According to
their repo, nothing else has changed [1].

The RPi and RPiW Dockerfiles were not updated because of compatibility
reasons. I cannot easily test those files and do not want to break
anything.

**References**

 1. https://git.fslab.de/jkonra2m/tinydtls-cython/commits/master
ggravlingen pushed a commit that referenced this issue Nov 18, 2018
This resolves issue #203 and also optimizes the Dockerfile to use less
resources. Also the current version from the Git repo is copied to
the Docker container for easy access.

I've taken the liberty to also update the DTLSSocket requirement to
version 0.1.7 which resolves an issue regarding cython. According to
their repo, nothing else has changed [1].

The RPi and RPiW Dockerfiles were not updated because of compatibility
reasons. I cannot easily test those files and do not want to break
anything.

**References**

 1. https://git.fslab.de/jkonra2m/tinydtls-cython/commits/master
@ggravlingen
Copy link
Member

This has been resolved in #206.

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

No branches or pull requests

2 participants