Docker on the RPi
This is just a place holder for a future guide and hopefully useful information for someone who searches.
Docker is a very interesting virtualization technology and I’ve been wondering what can be squeezed into a Raspian OS and 1gb RPi 3b+. So I decided to build it – but it went wrong on Raspian Buster.
Why Raspian? Well its the community supported OS based on Debian for RPi. I have other Pi images I’m happy with running on Ubuntu but its a bit messy with some hardware options. So I decided to use Raspian. However the latest “Buster” distribution versions from late 2019 on. Since I had run into a bunch dpkg errors … i thought i’d work with the older “stretch” distro of Raspian. Not much older – I got the latest one from here and used Imager from RPi to write it to microSD
These are 2 pieces of information I used so far to install it via apt instead of via the downloaded script from docker (which itself calls apt to retrieve it). I wanted it to just install like any other package.
Get the sources right
sudo touch /etc/apt/sources.list.d/docker.list ### then add this line to that docker.list sources file deb [arch=armhf] https://download.docker.com/linux/raspbian stretch stable
Documentation from Docker on how to install it via command line.
You should reboot before you get to the point of testing with
sudo docker run hello-world ##output from this Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 4ee5c797bcd7: Pull complete Digest: sha256:8e3114318a995a1ee497790535e7b88365222a21771ae7e53687ad76563e8e76 Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (arm32v7) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
Its good to know that Docker Images have to be made for the RPi system architecture so you have to find RPi images. The “docker-apps designed for x86/x64 and i386 architecture on your Raspberry Pi will return an error”.