When Docker is running with Archlinux on a Raspberry Pi2, it is time to create a first Docker Image.
- Get/pull a Docker Image from docker.com with “docker pull resin/rpi-raspbian” because this is Raspian 8 Jessie.
- Run the Docker Image with “docker run -t -i -p 8000:8000 –privileged philipz/rpi-raspbian /bin/bash”
- Make the necessary changes inside the Docker Image like wiringPi- and Homegear- installation.
- Exit with “exit”.
- Look at the Images in Detail with “docker images –tree”.
- Get the id of your new create container with “docker ps -a”.
- Create a new Docker Image with “docker commit c75b394afc64 steve/arm-homegear:0.5.24” (c75b394afc64 is the id you got in the last step)*
- Run the new Image with “docker run -t -i -p 8000:8000 –privileged steve/arm-homegear:0.5.24 /bin/bash”.
- Inside the new Docker Image type “gpio readall” to test the hardware access.
*Making Docker Changes persistent
As described here (german) and here (english) you can’t change the Docker Image, all changes take place in the Docker Container. It means when you restart the Docker Image everything is as before. Maybe you want this behaviour, because you want to restart with a clean Testenvironmet. If not, you need to transfer the actual Container to a new Docker Image.