Orange Pi 5 - Install Docker
2 mins
Orange Pi 5 - Install Docker #
This article describes how to install docker on an Orange Pi 5 to be used internally.
Prepare Server #
- Set Password
passwd
- Set Servername
sudo hostnamectl set-hostname spcon3xx
- Set Timezone
sudo timedatectl set-timezone Europe/Amsterdam
- Install Software
sudo apt update sudo apt install nano rsync dialog
- Install Public Key used for me
nano ~/.ssh/authorized_keys ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDL1k4NalbkMcFDUlAbDF5zv+w3FTvEP6Uy8hk/Zn/zwSgTZ0+a4W1fgp4WOq/bARqF1PGmEqz5iHNnydzWctzm6erJzz5prmuD/EvJDWyTV7g+UpGCmq+19PUeRWLtZkbFGfeZTM4eYMQUcX8EzvbQEGHR8IU3UsV95IWl5QkGlCOIbZ+2v5e+Q3AB7n+YNHg8fA2LWwvKfBSbDaCfyyxCEjvUdorSj4J111K8YASWjFNDMZ5P19tg4FUWY89MP9iy6MwrXuM5uhgD+TG+eTgOHzdMnPeaeZgxUFzEchYvjDaA8OvdZ0sr7BiZBuGW1oBhqLvf1xwVH8oHzskEZVmzB57UnuAs68qvjuh/FCTujPOYqNbtDdMZ0eqS4ouixY0IGApULuR1NZoOS96kLRA7QCCl+eqOtynS5tyKnzsSknWQ2RL4XeZfZNigJotywKrHNrUegtCx9mXaGJ27/1IpC+ztGRbILaQpok4VbLpGZanFB5uwvYQh6p7M43Ron3E= solvinity\sdurand@SOLV8W1C3M2
- Install Public Key for GitHub Actions
nano ~/.ssh/authorized_keys ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDVTPmJ1TGCoIpUvhBtTAHdNLdrI6fvGk2MRbz9oK4bLpsqNoxPer7kYM8BzKmaF9069LRjlUaxkwXaFuELfpSHuvtChX/EQHkQCXcOQTy6z+PTf+HCpruy/Jrbyztu2M8/52gTyJb0vV82r/WIGp0SO1ka9KDTRfQwyJZxpyK54TKzYyeecBImqjc4jerOSuMmsUJE19/1eLujA4OqciHcGz/0RthUszmNxxq2L6qPpvi+T++nLrTcpgNySIPhPOLYl7IDPHxbN1WC2n7kJNQ9PQGsg7LHw17XtJ5a8oyz4UzzKp6EX2EbIT5ywgvRWQxS5swIfCJiCTJ/+88fyKStG/Ci+E4dKTk1N8sUT+5E7jC+gIHjl9WgYfucxRauPtoN6FDBmaew/Ih+te7MyiH/+X2IALpd0TNEf0b2yEtLRhRoxC+sHsczagP+NSW8EKMDiCGqsgbK5ajG4Bc992MEjX7BtQBRZrX058s+1p8tWQ4coj+w7Ac/Zl75PW85WxM= ubuntu@spcon902
- Set Server Networking
- Check current netplan (and nic name)
netplan status --all
- Set NIC to static IP’s (use nic name from step 1)
sudo netplan set --origin-hint end1 "ethernets.end1={dhcp4: false, dhcp6: false, accept-ra: false, addresses: "[10.252.20.32/24,2a02:xxxx:xxxx:20::32/64]"}"
- Set IPv4 Route (use nic name from step 1)
sudo netplan set ethernets.end1.routes='[{"to":"default", "via": "10.252.20.1"}]'
- Set IPv6 Route (use nic name from step 1)
sudo netplan set ethernets.end1.routes='[{"to":"default", "via": "2a02:xxxx:xxxx:20::1"}]'
- Set DNS Suffix (use nic name from step 1)
sudo netplan set ethernets.end1.nameservers.search="[durand.li]"
- Set DNS Servers (use nic name from step 1)
sudo netplan set ethernets.end1.nameservers.addresses="[10.252.20.1,2a02:xxxx:xxxx:20::1]"
- Check Config
sudo netplan get
- Apply Config
sudo netplan apply
- Check if server is reachable
- Check current netplan (and nic name)
Add VLAN’s if applicable #
VLAN’s to be used by Docker, so no IP assignment. Maximum of 3 VLAN’s supported!
- Add VLAN (change numbers/link nic)
sudo netplan set --origin-hint vlan12 "vlans.vlan12={id: 12, link: end1, dhcp4: false, dhcp6: false, accept-ra: false}"
- Repeat Step 1 for more VLAN’s if nescecarry
- Apply the config
- Check if server is reachable
Install and config Docker #
- Add Docker’s official GPG key:
sudo apt-get update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc
- Add the repository to Apt sources:
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update
- Install Docker
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- Docker User
sudo groupadd docker sudo usermod -aG docker $USER
- Enable IPv6
sudo nano /etc/docker/daemon.json
- Add the following Config
{ "ipv6": true, "fixed-cidr-v6": "fd00::/80" }
- Restart Docker
sudo systemctl restart docker
- Create Docker-Config-File directory
mkdir ~/docker-config-files
- Reboot Server