I will continue to refer to the OS as Raspbian because (1) that’s what they named it when first released and (2) it still says that on the operating sytem. Therefore the name has stuck and still sticks.
Here are the steps to install Docker and the Portainer container that provides your Docker installation with a simple, web-based dashboard.
Update 64-bit Raspbian:
sudo apt update && sudo apt upgrade -y
Install Docker from the Docker website:
curl -sSL https://get.docker.com | sh
pi account to the
docker user group so that you can execute docker commands without sudo:
sudo usermod -aG docker pi
Log back in and test Docker by installing and running the following container.
docker run hello-world
The container will run and tell you it was successful with additional information about Docker and its OS.
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. (arm64v8) 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. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/
To be honest, I haven’t tried the recommendation about running the Ubuntu container, as I don’t know if it there is an ARM Ubuntu container (there is ARM Ubuntu, however) and if it will select the right container if there is such a container.
Install the next two containers. The first is a very simple http container.
docker run -d -p 80:80 hypriot/rpi-busybox-httpd
Navigate to http://localhost with Chromium and you’ll see this:
Now add the dashboard container that implements Portainer for ARM.
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer:arm
Navigate to http://localhost:9000/ and create an admin password for the admin account. Once that is accomplished, you’ll see something very similar to this:
If you want any container to restart after a re-boot, then you need to modify the container’s restart policy. Otherwise, on reboot, no containers are running. For example
docker update --restart=always [container ID]
where he container ID can be found with a
docker ps from the command line. You can set restart to always from the command line with the docker run command as well.
It’s a limitation to this application I don’t like. I’m looking for something more comprehensive, or else, (shudder) I fork the application and “fix” it myself.