When I received my first Raspberry Pi 2, I thought: “maybe I can use it as a web server to host a few of my websites”.
Trying different configurations and security options, I had to start all over a few times… Hours and hours redoing more or less the same things again and again. Now I received a Raspberry Pi 3 and I’d like to transfer my web server on this new device, and I have to redo it completely again? No way…
Docker is a good way to create a development environment that you can then ship as a production environment on another machine without having to redo everything manually.
So if you’re bored of installing and configuring all the time your environments use Docker, and it works on our little Raspberries.
While working with Docker images and containers on an ARM device still has some issues to handle as opposed to mainstream hardware, the installation of a bare-bones machine with Docker on top is quite straightforward. Installing Docker on Raspberry Pi. First, setup a standard Raspbian (Lite) on your SD card. In my case this problem was solved by rebooting after installing updates, and before trying to install Docker. This will likely occur if you suddenly bring an older version of Raspbian up-to-date, and then straight away try to install Docker, as it appears some of the core binaries (or maybe even the kernel itself!) has been updated, the docker installer is reading those newer versions/files. However, Raspbian provides more than a pure OS: it comes with over 35,000 packages, pre-compiled software bundled in a nice format for easy installation on your Raspberry Pi. Docker today support the latest Raspbian Buster release. If you really want to play around with stable release of Docker for Raspbian Buster, then head over to this link.
The official documentation is pretty clear and straight forward, but here are the big lines.
First allow Docker to be installable and upgradable through APT:
This docker.list file should only contain this line:
Now we can install Docker and configure the security group:
Here you should do a Log off – Log on and then test the installation:
Enjoy ! 🙂
PS: I you’re wondering what this is, just follow this tutorial.
Raspbian Docker Container
Build and run container images with Docker.
- This build can only access files in the home directory. So Dockerfiles and all other files used in commands like
docker loadneed to be in $HOME.
- You can change the configuration of this build by modifying the files in
- Additional certificates used by the Docker daemon to authenticate with registries need to be added in
Running Docker as normal user
By default, Docker is only accessible with root privileges (
sudo). If you want to use docker as a regular user, you need to add your user to the
Warning: if you add your user to the
docker group, it will have similar power as the
root user. For details on how this impacts security in your system, see https://docs.docker.com/engine/security/#docker-daemon-attack-surface
This snap is built by Canonical based on source code published by Docker, Inc. It is not endorsed or published by Docker, Inc.
Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries. Docker, Inc. and other parties may also have trademark rights in other terms used herein.