Docker ~01 Docker and Raspberry Pi

Today I tried to install Docker on my Raspberry Pi 3 board to check how it will work, just for testing purpose. And you know what? It works very nice. First of all, I install Raspbinan Jessie Lite on SD card. For this point, I log in on a fresh installation and make the system update. After update list of repositories, I made the update of the whole raspberry:

Next step is to install Docker directly from the Docker website for ARM architecture.

This process will take a few minutes. After installation finished we will see the latest installation of Docker and that is running on ARM architecture:

Installation process suggests us to use user pi and add them to docker group. This will allow us to run docker command without using the sudo command.

To check that Docker demons are running we can use: sudo docker info

As you can see docker demons are running. After running classic: sudo docker run hello-world docker can’t find hello version:

The container didn’t start. This problem appears due to incompatible between two architectures: ARM and x86. To solve this problem the best way is to find Docker image that can be run on ARM architecture. So how can we find this image?

The best way is to find an image on Docker Hub. Searching for: ARM or RPI.

Another way is use Docker build to build our own Docker images for Raspberry. To create simple Dockerfile we must create the build directory, and in this folder placed Dockerfile that in my case contains:

To run Docker build: sudo docker build -t /rpi-java8 .
The build will take a while. After finish, we can check by using: sudo docker images. This will list:

To run created Docker image we can use: sudo docker run -it /rpi-java8. But this displayed all options for java because I didn’t specify anything. After adding some variables like: java -version we can see: