Part 2: Installing Docker in Raspberry Pi 4

How to prepare a Docker ready development environment for rapid prototyping

Customizing Ubuntu 20.04 Focal

$ sudo apt update && sudo apt upgrade
$ sudo visudo
pi ALL=(ALL) NOPASSWD: ALL
$ sudo apt install net-tools
$ sudo apt install git openssh-server
$ sudo systemctl status ssh
$ hostname
$ ssh pi@<HOSTNAME>.local
$ ssh pi@<IP_ADDRESS>

Setting up Docker

$ sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88
$ sudo add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
$ sudo apt-get update
$ apt-cache policy docker-ce
$ sudo apt-get -y install docker-ce
$ sudo usermod -aG docker ${USER}
$ docker run --rm hello-world
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
$ docker ps -a
$ docker images
$ docker run -it ubuntu bash
$ sudo apt install python3-pip
$ sudo pip3 install docker-compose
$ git clone https://github.com/therobotacademy/docker-compose-hello-world
$ cd docker-compose-hello-world
$ docker-compose up -d
$ docker-compose ps
$ docker-compose down

Software Engineer spreading cutting edge technologies. Psychologist applying the current knowledge of the human brain to power intelligent robots & IoT devices

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store