├── Dockerfile └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | # Pull base image 2 | FROM resin/rpi-raspbian:jessie 3 | MAINTAINER Andrew Cencini 4 | 5 | # Install dependencies 6 | RUN apt-get update && apt-get install -y \ 7 | git-core \ 8 | build-essential \ 9 | gcc \ 10 | python \ 11 | python-dev \ 12 | python-pip \ 13 | python-virtualenv \ 14 | --no-install-recommends && \ 15 | rm -rf /var/lib/apt/lists/* 16 | RUN pip install pyserial 17 | RUN git clone git://git.drogon.net/wiringPi 18 | RUN cd wiringPi && ./build 19 | RUN pip install wiringpi2 20 | 21 | # Define working directory 22 | WORKDIR /data 23 | VOLUME /data 24 | 25 | # Define default command 26 | CMD ["bash"] 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rpi-python-serial-wiringpi 2 | 3 | Raspberry Pi compatible Docker base image with Python, C, serial support (pyserial) and GPIO support (wiringpi2, libwiringpi) preinstalled. Adapted from [Hypriot's](https://github.com/hypriot) [rpi-python](https://github.com/hypriot/rpi-python). 4 | 5 | [rpi-python-serial-wiringpi at DockerHub](https://registry.hub.docker.com/u/acencini/rpi-python-serial-wiringpi/) 6 | 7 | [HypriotOS](http://blog.hypriot.com/) 8 | 9 | Run all the commands from within the project root directory. 10 | 11 | #### Build the Docker Image 12 | From within the same directory as Dockerfile: 13 | 14 | ```bash 15 | docker build -t . 16 | ``` 17 | 18 | #### Run the Image in HypriotOS with Docker (interactively) 19 | Replace YOUR_IMAGE_HERE with image name (acencini/rpi-python-serial-wiringpi if getting from DockerHub) that you created. 20 | 21 | ``` 22 | docker run --device /dev/mem:/dev/mem --device /dev/ttyAMA0:/dev/ttyAMA0 --privileged -ti YOUR_IMAGE_HERE /bin/bash 23 | ``` 24 | 25 | [MIT Licensed]([http://opensource.org/licenses/MIT]) 26 | 27 | --------------------------------------------------------------------------------