Create a Docker Image on a Raspberry Pi2

When Docker is running with Archlinux on a Raspberry Pi2, it is time to create a first Docker Image.

  1. Get/pull a Docker Image from docker.com with “docker pull resin/rpi-raspbian” because this is Raspian 8 Jessie.
  2. Run the Docker Image with “docker run -t -i -p 8000:8000 –privileged philipz/rpi-raspbian /bin/bash”
  3.  Make the necessary changes inside the Docker Image like wiringPi- and Homegear- installation.
  4. Exit with “exit”.
  5. Look at the Images in Detail with “docker images –tree”.
  6. Get the id of your new create container with “docker ps -a”.
  7. 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)*
  8. Run the new Image with “docker run -t -i -p 8000:8000 –privileged steve/arm-homegear:0.5.24 /bin/bash”.
  9. 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.

 

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: