Skip to content

Docker blues #88

@StevePoling

Description

@StevePoling

The Dockerfile doesn't seem to work for me. So, I made some tweaks.

  • Changed the FROM image to balenalib/rpi-raspbian:jessie to avoid a "deprecated" message.
  • added apt-get install git
  • added git clone (this repo)
  • dropped the copy of /library and /examples

This allowed me to successfully build a docker image, but when I run it I get this unhappy message:

Traceback (most recent call last):
File "larson.py", line 5, in
import blinkt
File "/usr/local/lib/python2.7/dist-packages/blinkt.py", line 5, in
import RPi.GPIO as GPIO
File "/usr/lib/python2.7/dist-packages/RPi/GPIO/init.py", line 23, in
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

Is there something I'm missing to tell python-rpi, or docker that I'm running on an RPi4?

MacOS wouldn't let me attach my Dockerfile. So here it is inline:

FROM balenalib/rpi-raspbian:jessie
RUN apt-get update -qy && apt-get install -qy
git
python
python-rpi.gpio
ENTRYPOINT []
RUN git clone https://github.com/pimoroni/blinkt.git /blinkt
WORKDIR /blinkt/library
RUN python setup.py install
WORKDIR /blinkt/examples/
CMD ["python", "larson.py"]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions