├── README.md ├── omv-steps.md └── ubuntu-20.04 ├── .env ├── README.md └── docker-compose.yaml /README.md: -------------------------------------------------------------------------------- 1 | # RaspberryPi 4 - Docker Setup with Raspbian OS 64 bit on Bullseye 2 | 3 | This guide contains several options to configure docker on raspbian OS 64 bit. This guide is provided as-is. Use at your own risk. This guide does not go into detail of setting up containers after the initial installation is complete. This is only for the installation of docker. Building containers via dockerfile or docker-compose is not covered here. There are plenty of guides online that discusses this topic. 4 | 5 | ## **Quick Setup** 6 | **_Tip_:** Below are some recommendations to do prior to installing docker. 7 | - Make sure your user name has sudo access. If not, refer to the official documentation. 8 | - Run the commands `sudo apt update` and `sudo apt upgrade` to bring the OS up-to-date. 9 | - Check that the timezone is set to your region. Use the command `date` to view the current settings. Run `sudo raspi-config` to set the timezone for your region. 10 | - Check that the locale is set to your region. Use the command `locale` to view the current settings. Run `sudo raspi-config` to set the locale for your region. Reboot for the changes to take affect. 11 | - This guide assumes only ethernet will be used. It is recommended to disable the wireless interface if it will not be used by adding the following option to `/boot/config.txt`. 12 | ``` 13 | dtoverlay=disable-wifi 14 | ``` 15 | 16 | The easiest method to setup docker on raspbian OS 64 bit is to use the [convenience script](https://docs.docker.com/engine/install/debian/#install-using-the-convenience-script). After the installation is complete, add your user to the docker group to run docker commands directly. Run the command `sudo usermod -aG docker (your_username)` then log out and log back in for the changes to take affect. If you do not plan to use a [user-defined bridge](https://docs.docker.com/network/bridge/) or a [macvlan](https://docs.docker.com/network/macvlan/), docker is now ready to use. 17 | 18 | ## **User-defined bridge** 19 | Use the following example to create a [user-defined bridge](https://docs.docker.com/network/bridge/). The default bridge `docker0` in docker does not allow containers to connect each other via container names used as dns hostnames. Therefore, it is recommended to create a user-defined bridge and attach the containers to that bridge. Change the bridge name, subnet and gateway ip to the desired setting. See the example below. 20 | ``` 21 | docker network create -d bridge --subnet 192.168.10.0/24 \ 22 | --gateway 192.168.10.1 \ 23 | -o "com.docker.network.bridge.host_binding_ipv4"="0.0.0.0" \ 24 | -o "com.docker.network.bridge.enable_ip_masquerade"="true" \ 25 | -o "com.docker.network.bridge.enable_icc"="true" \ 26 | -o "com.docker.network.bridge.name"="armnet" \ 27 | -o "com.docker.network.driver.mtu"="1500" armnet 28 | ``` 29 | 30 | #### **(Optional)** Disable the default bridge 31 | To disable the default bridge `docker0`, create a new file`/etc/docker/daemon.json` with the following setting. Do not do this if you want to keep 32 | the default docker bridge. Please note this step is optional and it assumes you have created a user-defined bridge as noted above this section. If you have not created or do not want a user-defined bridge, skip this step. If daemon.json already exists, be sure to add commas as needed for the json config. 33 | ```json 34 | { 35 | "bridge": "none" 36 | } 37 | ``` 38 | ## **Macvlan** 39 | Add a [macvlan](https://docs.docker.com/network/macvlan/) network to docker by selecting an ip range not being used by DHCP or by other hosts. If a host bridge is used, replace eth0 with br0 or with the name of the bridge interface. The subnet 192.168.0.0/24 is used to match the current network that is being used. The default gateway is also specified. The ip range defines which ip addresses will be available for docker to use. Setting the subnet mask to /30 will allow the macvlan to use the ip range `192.168.0.88 - 192.168.0.91`. Docker will assign an ip address automatically or an ip address can be set statically. Lastly, name the network as `macvlan` or to the desired name. See the example below. 40 | ``` 41 | docker network create -d macvlan -o parent=eth0 \ 42 | --subnet 192.168.0.0/24 --gateway 192.168.0.1 \ 43 | --ip-range 192.168.0.88/30 macvlan 44 | ``` 45 | 46 | **_Tip_:** The above example will allow a container to be reachable outside the host. It will not allow communication between the host and the container. For containers to be able to communicate with the host, additional network settings must be added. See below for details. 47 | 48 | #### **(Optional)** Add configuration for systemd-networkd to provide a macvlan bridge for docker. 49 | If a host bridge is being used, create a new file named `/etc/systemd/network/br0.network` using the editor of your choice. The file should contain the following settings: 50 | ``` 51 | [Match] 52 | Name=br0 53 | 54 | [Network] 55 | MACVLAN=mac0 56 | ``` 57 | 58 | If a host bridge is not being used, create a new file named `/etc/systemd/network/eth0.network` using the editor of your choice. The file should contain the following settings: 59 | ``` 60 | [Match] 61 | Name=eth0 62 | 63 | [Network] 64 | MACVLAN=mac0 65 | ``` 66 | 67 | Next, create a new file named `/etc/systemd/network/mac0.netdev` using the editor of your choice. The file should contain the following settings: 68 | ``` 69 | [NetDev] 70 | Name=mac0 71 | Kind=macvlan 72 | 73 | [MACVLAN] 74 | Mode=bridge 75 | ``` 76 | Then create a new file named `/etc/systemd/network/mac0.network` using the editor of your choice. The file should contain the following settings: 77 | ``` 78 | [Match] 79 | Name=mac0 80 | 81 | [Network] 82 | DHCP=no 83 | ipForward=yes 84 | LinkLocalAddressing=no 85 | Address=192.168.0.87/24 86 | Gateway=192.168.0.1 87 | DNS=192.168.0.1 88 | DNS=1.1.1.1 89 | Domains=example.net 90 | ``` 91 | The above example uses a static ip. The ip address will act as the bridge used for the macvlan. Set the ip addresses to the desired settings. Change the domain to the desired domain name. 92 | 93 | **_IMPORTANT_:** If a host bridge is not being used, enable systemd-networkd when the system starts: `sudo systemctl enable systemd-networkd`. Edit the file `/etc/dhcpcd.conf` using the editor of your choice. Add the following settings to the file. 94 | ``` 95 | # Deny DHCP to the following interfaces 96 | denyinterfaces mac0 97 | 98 | # Configure the interface 99 | interface eth0 100 | ``` 101 | **_Tip_:** If DHCP is being used, place both settings at the end of the file. Otherwise put the `denyinterfaces mac0` before any `interface` setting. A static ip address can be configured if desired. See the example provided in the file. 102 | 103 | ## **(Optional) Create a bridge on the host.** 104 | This can be handy if you plan on using other services such as qemu along with docker. Create the file `/etc/systemd/network/br0.netdev` using the editor of your choice. The file should contain the following settings. 105 | ``` 106 | [NetDev] 107 | Name=br0 108 | Kind=bridge 109 | ``` 110 | Next, create a file named `/etc/systemd/network/eth0.network` using the editor of your choice. The file should contain the following settings: 111 | ``` 112 | [Match] 113 | Name=eth0 114 | 115 | [Network] 116 | Bridge=br0 117 | ``` 118 | Now enable systemd-networkd when the system starts: `sudo systemctl enable systemd-networkd` This will create and populate the bridge interface during boot. 119 | Finally, edit the file `/etc/dhcpcd.conf` using the editor of your choice. Add the following settings to the file. 120 | ``` 121 | # Deny DHCP to the following interfaces 122 | denyinterfaces eth0 mac0 123 | 124 | # Configure the interface 125 | interface br0 126 | ``` 127 | **_Tip_:** If DHCP is being used, place both settings at the end of the file. Otherwise put the `denyinterfaces eth0 mac0` before any `interface` setting. A static ip address can be configured if desired. See the example provided in the file. Remove `mac0` if you do not use macvlan bridge. 128 | -------------------------------------------------------------------------------- /omv-steps.md: -------------------------------------------------------------------------------- 1 | ### About this guide 2 | Hello and welcome. I am [shadowzero](https://forum.openmediavault.org/wsc/index.php?user/2842-shadowzero/) from the [OMV forums](https://forum.openmediavault.org/). I used to contribute to openmediavault some time ago. After OMV 3 was released, my priorities changed. Since then, I have contributed in testing the [omv-extras](https://wiki.omv-extras.org/) kvm plugin on the Raspberry Pi 4. I still think OMV is awesome. I just don't use it on a regular basis anymore. I prefer building my own "GUI/Web Interface" based on docker containers and kvm while retaining most activities to CLI based functions. Aside from my guides to do this without OMV, I still like to show this project some love by contributing when I can. 3 | *** 4 | How to setup KVM and Docker on OMV 6 5 | *** 6 | This guide/howto will walk you through a new installation of [openmediavault](https://www.openmediavault.org/) 6. Then we will add support for kvm and docker to run together over a bridged network interface. Some knowledge of configuring networking on raspberry pi is recommended. 7 | 8 | ### Install OS 9 | Install the latest raspios lite 64 OS image from https://downloads.raspberrypi.org/raspios_lite_arm64/images/ to your SD card or USB drive flashed with the latest arm64 image. As of this guide, version: [2022-04-04-raspios-bullseye-arm64-lite.img.xz](https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2022-04-07/2022-04-04-raspios-bullseye-arm64-lite.img.xz),[torrent](https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2022-04-07/2022-04-04-raspios-bullseye-arm64-lite.img.xz.torrent) are used in the examples below. After you have flashed either an SD card or USB drive, follow the inital setup. Once you are able to login via console or ssh, run the following commands: 10 | ``` 11 | sudo apt-get update 12 | 13 | sudo apt-get upgrade -y 14 | 15 | sudo rm -f /etc/systemd/network/99-default.link 16 | ``` 17 | When all three commands above are complete, type `sudo reboot` and log back into your device. 18 | 19 | ### Install OMV 6 via script: 20 | Run the following command to install OMV 6: 21 | `wget -O - https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install | sudo bash` 22 | ### Setup the bridge: 23 | After the OMV install is complete, navigate to: `home > network > interfaces`. Select `eth0` and then `delete` by clicking `yes`. 24 | Add a new bridge interface named `br0` that uses `eth0`. Reboot after making the changes. 25 | ### Install the docker and kvm plugins 26 | See the steps below: 27 | - Install docker from omv-extras. 28 | - Install kvm plugin from omv-extras. 29 | - Add your user to libvirt and kvm groups. This will eliminate the need for sudo. 30 | - Optional: install virt-manager on a client machine to manage kvm. 31 | 32 | ### Setup kvm to use the bridge 33 | To list current network settings, run the commad below. This example shows the default which is virbr0. 34 | ``` 35 | pi@omv:~ $ virsh net-list --all 36 | Name State Autostart Persistent 37 | ---------------------------------------------- 38 | default inactive no yes 39 | ``` 40 | Create the file `host-bridge.xml` and add the the following: 41 | ``` 42 | 43 | host-bridge 44 | 45 | 46 | 47 | ``` 48 | Next, we will add it by executing the following command: `pi@omv:~ $ virsh net-define host-bridge.xml`. 49 | Check the network settings again and you should now see the `host-bridge` has been added. See the example below. 50 | ``` 51 | `pi@omv:~ $ virsh net-list --all` 52 | virsh net-list --all 53 | Name State Autostart Persistent 54 | -------------------------------------------------- 55 | default inactive no yes 56 | host-bridge active no yes 57 | ``` 58 | Start the host-bridge with the following command: 59 | ``` 60 | pi@omv:~ $ virsh net-start host-bridge 61 | Network host-bridge started 62 | ``` 63 | We will want the host-bridge to start automatically. Run the following command: 64 | ``` 65 | pi@omv:~ $ virsh net-autostart host-bridge 66 | Network host-bridge marked as autostarted 67 | ``` 68 | We need to set iptables to allow fowarding on the bridge network `br0`. This will allow kvm and docker to use the same bridge interface. 69 | Run the following command:`sudo iptables -A FORWARD -i br0 -o br0 -j ACCEPT` 70 | 71 | Lastly, we need to make the changes persistent. Run the following command: 72 | `sudo apt install -y iptables-persistent` then follow the prompts when installing the package. 73 | You should now be able to run kvm and docker together on OMV 6. Enjoy! :) 74 | -------------------------------------------------------------------------------- /ubuntu-20.04/.env: -------------------------------------------------------------------------------- 1 | COMPOSE_PROJECT_NAME=armnet 2 | -------------------------------------------------------------------------------- /ubuntu-20.04/README.md: -------------------------------------------------------------------------------- 1 | **Please note the information below is outdated. See [Ubuntu releases](https://wiki.ubuntu.com/Releases)**: for details. 2 | 3 | # Raspberry Pi 4 - Docker Setup with Ubuntu 20.04 LTS 4 | This document describes the steps that were used to create a docker environment on a Raspberry Pi 4 using a SSD without a microsd card. 5 | In order to boot from a SSD, follow the steps outlined at [krdesigns.com](https://krdesigns.com/articles/Boot-raspbian-ubuntu-20.04-official-from-SSD-without-microsd). 6 | 7 | Here are some options that are suggested to change before installing docker. All of the steps are completely optional. 8 | 1. Rename the default ubuntu username 9 | 2. Install argon1.sh script for the Argon ONE Pi 4 Raspberry Pi Case 10 | 3. Disable the microsd status (green) light 11 | 4. Disable wireless and bluetooth 12 | 5. Install Network Manager for macvlan bridge support 13 | 6. Set the hostname, timezone and NTP servers 14 | 7. Do a final update check before rebooting 15 | 16 | ## Rename the default ubuntu username 17 | I prefer to login with my username rather than ubuntu. Why change it though? It's a personal preference to keep my user id and group id the same across all of my devices. This can be done with the [cloud-config](https://cloudinit.readthedocs.io/en/latest/topics/examples.html) settings before initial boot. To keep it simple without using with the cloud-config, Here are some basic commands to do this. 18 | 19 | **Note:** Root privileges are required to make these changes. Login as root on the Raspberry Pi or via ssh. Do not use su while logged into the ubuntu user. 20 | 21 | Run the following commands as root: 22 | ``` 23 | usermod -l ubuntu 24 | usermod -m -d /home/ 25 | groupmod -n ubuntu 26 | ``` 27 | Replace \ with your desired username. 28 | 29 | ## Install argon1.sh script for the Argon ONE Pi 4 Raspberry Pi Case 30 | The original script provided by Argon40 doesn't have support for Ubuntu. Luckily, [meuter/argon-one-case-ubuntu-20.04](https://github.com/meuter/argon-one-case-ubuntu-20.04) has provided an updated script to do just that. Follow the instructions to use the script with the Argon ONE case. 31 | 32 | ## Disable the microsd status \(green\) light 33 | This is purely cosmetic. Booting from SSD renders this light no longer useful. Edit `/boot/firmware/config.txt` and add the following under the `[pi4]` tag. 34 | ``` 35 | # Disable the Activity LED 36 | dtparam=act_led_trigger=none 37 | dtparam=act_led_activelow=off 38 | ``` 39 | 40 | ## Disable wireless and bluetooth 41 | Wireless and bluetooth are not needed. To disable them during boot, edit `/boot/firmware/config.txt` and add the following under the `[all]` tag. 42 | ``` 43 | dtoverlay=disable-bt 44 | dtoverlay=disable-wifi 45 | ``` 46 | ## Install Network Manager for macvlan bridge support 47 | Netplan doesn't support macvlans natively. Initial testing to setup a macvlan with netplan using networkd failed to survive a reboot. Going back to using ifupdown was not an option. Use the script example found in the [bug #1664847](https://bugs.launchpad.net/netplan/+bug/1664847) to setup a macvlan bridge so the Raspberry Pi can communicate with containers using macvlan. If macvlan bridging will not be used then this section can be skipped. 48 | 49 | After installing the `network-manager` package, there is some additional steps to do before rebooting. 50 | 1. Add the script mentioned in the bug above as a workaround to allow macvlan bridging. Edit `/etc/NetworkManager/macvlan.sh` and add the following example: 51 | ``` 52 | #!/usr/bin/bash 53 | 54 | IFACE=${1} 55 | ACTION=${2} 56 | 57 | if [[ "${IFACE}" == "br0" && "${ACTION}" == "up" ]]; then 58 | ip link add link br0 name macvlan0 type macvlan mode bridge 59 | ip addr add 172.29.10.224/32 dev macvlan0 60 | ip link set macvlan0 up 61 | ip route add 172.29.10.224/27 dev macvlan0 62 | fi 63 | 64 | if [[ "${IFACE}" == "br0" && "${ACTION}" == "pre-down" ]]; then 65 | ip route del 172.29.10.224/27 66 | ip link set macvlan0 down 67 | ip link del dev macvlan0 68 | fi 69 | ``` 70 | Change the IP addresses to match the desired settings. Set the appropriate ownership/permissions and symlink to the hook locations. 71 | ``` 72 | chown root:root /etc/NetworkManager/macvlan.sh 73 | chmod 700 /etc/NetworkManager/macvlan.sh 74 | ln -s /etc/NetworkManager/macvlan.sh /etc/NetworkManager/dispatcher.d/pre-up.d/macvlan.sh 75 | ln -s /etc/NetworkManager/macvlan.sh /etc/NetworkManager/dispatcher.d/pre-down.d/macvlan.sh 76 | ln -s /etc/NetworkManager/macvlan.sh /etc/NetworkManager/dispatcher.d/no-wait.d/macvlan.sh 77 | ln -s /etc/NetworkManager/macvlan.sh /etc/NetworkManager/dispatcher.d/macvlan.sh 78 | ``` 79 | 80 | 2. Edit /etc/netplan/50-cloud-init.yaml and add the renderer for NetworkManager. 81 | - If you plan to use dhcp, this is the only change needed. 82 | - If you plan to use a static IP then set the desired settings. See the example below. 83 | ``` 84 | network: 85 | version: 2 86 | renderer: NetworkManager 87 | ethernets: 88 | eth0: 89 | addresses: 90 | - 10.10.10.2/24 91 | gateway4: 10.10.10.1 92 | nameservers: 93 | search: [mydomain, otherdomain] 94 | addresses: [10.10.10.1, 1.1.1.1] 95 | ``` 96 | 97 | 3. Create a new file named `/etc/cloud/cloud.cfg.d/99-disable-network-config.cfg` and add the following: `network: {config: disabled}` 98 | 4. **Optional:** If you do not want Network Manager changing `/etc/resolv.conf` add `dns=none` to /etc/NetworkManager/NetworkManager.conf under the `[main]` section. You can then disable the systemd-resolved daemon as it is no longer being used. Use the following command as root or using sudo: `systemctl disable systemd-resolved`. You will also need to remove the old symbolic link and create a new `/etc/resolv.conf` file with your nameservers. 99 | 5. Disable networkd as it will no longer be used after rebooting. Use the following command as root or using sudo: `systemctl disable systemd-networkd` 100 | 101 | ## Set the hostname, timezone and NTP servers 102 | 1. Set the hostname using the following command as root or using sudo: `hostanmectl set-hostname `. Replace with your desired name. 103 | 2. Set the timezone using the following command as root or using sudo: `timedatectl set-timezone `. Replace with your desired timezone. 104 | 3. Set the NTP servers to be used by editing `/etc/systemd/timesyncd.conf` file. Uncomment `NTP=` and add your NTP server. Optionally, you can set a fallback NTP server. 105 | 106 | ## Do a final update check before rebooting 107 | Run the following command as root or using sudo: `apt get update && apt get upgrade -y` and then finally reboot. The Raspberry Pi should now be ready to install docker. Verify ssh is accessible to continue. If not, check back through the previous steps. 108 | 109 | ## Install Docker 110 | Use the steps outlined on the [docker installation guide](https://docs.docker.com/engine/install/ubuntu/) or alternatively use the provided [package](https://packages.ubuntu.com/focal/docker.io) in the Ubuntu repository. Please only choose one. 111 | - Check to make sure the username is part of the docker group. This can be checked with the following command: `id |grep docker`. If not, use the following command: `usermod -aG docker `. This will add the user to the docker group to run commands as a non-root user. See the [docker documentation](https://docs.docker.com/engine/install/linux-postinstall/) for more details. 112 | 113 | ## Install docker-compose 114 | Installing docker-compose can be done using several methods. The easiest method is to install the `docker-compose` package. However, this version is behind the latest release. This is not a bad thing either. Alternative methods include using [linuxserver.io](https://hub.docker.com/r/linuxserver/docker-compose) container image or the [binary](https://github.com/linuxserver/docker-docker-compose) available for arm64 can also be used. In this example, the binary file will be used. Use the following commands as root or using sudo: 115 | ``` 116 | wget https://github.com/linuxserver/docker-docker-compose/releases/download/1.27.4-ls17/docker-compose-arm64 117 | mv docker-compose-arm64 docker-compose && mv docker-compose /usr/local/bin 118 | chown root. /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose 119 | ``` 120 | Test the version by running the following command: `docker-compose --version` 121 | 122 | ## Docker macvlan 123 | Use the following to create a macvlan for the stack to use. Replace the parent 124 | device and networking information. Below is an example to use IP addresses from 125 | a network range not used by dhcp. I opted not to create the network settings 126 | in the compose file. Additional information: https://docs.docker.com/network/macvlan 127 | ``` 128 | docker network create -d macvlan -o parent=eth0 \ 129 | -o "com.docker.network.macvlan.name"="macvlan" \ 130 | --subnet 192.168.0.0/24 --gateway 192.168.0.1 \ 131 | --ip-range 192.168.0.88/30 macvlan 132 | ``` 133 | **Note:** The option -o "com.docker.network.macvlan.name"="macvlan" is optional and not needed. 134 | 135 | To see a list of IPs that will be available for docker to assign, use this 136 | IP Calculator: http://jodies.de/ipcalc 137 | 138 | Network: 192.168.0.88/30 \ 139 | Broadcast: 192.168.0.91 \ 140 | HostMin: 192.168.0.89 \ 141 | HostMax: 192.168.0.90 142 | 143 | Even though the range only shows 2 IPs, all of the IPs can be used since the 144 | containers will use the host subnet. In this example, /24 is used for the host. 145 | 146 | To allow the host running the containers network access, use the following 147 | settings to create a bridge. Either use sudo or login as root and run these 148 | commands. 149 | 150 | ip link add mac0 link eth0 type macvlan mode bridge \ 151 | ip addr add 192.168.0.88/30 dev mac0 \ 152 | ip link set up mac0 153 | 154 | Note: If you are using Netplan, there is a known bug https://bugs.launchpad.net/netplan/+bug/1664847 which doesn't support macvlan 155 | after a reboot. Please see https://gist.github.com/timcharper/d547fbe13bdd859f4836bfb02197e295 and https://gist.github.com/jooter/8f95555021d2a4e7cb6241368473ed55 for example workarounds with networkd. I tried this method but was unable to get it to retain after 156 | a reboot. Using the Network Manager method mentioned in the bug works. While not ideal, there seems to be no good implementation documented for going the networkd method. Going back to using ifupdown from the Ubuntu archive was not an option either I was willing to explore. 157 | 158 | ## Docker bridging 159 | Use the following to create a bridge for the stack to use. The default bridge 160 | network in docker does not allow containers to connect each other via container 161 | names used as dns hostnames. Therefore, it is recommended to first create a user 162 | defined bridge network and attach the containers to that network. This must also 163 | be done prior to using docker-compose. I opted not to create the network settings 164 | in the compose file. Change the bridge name to whatever you want along with the 165 | subnet and gateway IP. Keep armnet the same or replace all instances 166 | with the name you want to use. See The example below: 167 | 168 | docker network create --d bridge --subnet 192.168.10.0/24 \ 169 | --gateway 192.168.10.1 \ 170 | -o "com.docker.network.bridge.host_binding_ipv4"="0.0.0.0" \ 171 | -o "com.docker.network.bridge.enable_ip_masquerade"="true" \ 172 | -o "com.docker.network.bridge.enable_icc"="true" \ 173 | -o "com.docker.network.bridge.name"="armnet" \ 174 | -o "com.docker.network.driver.mtu"="1500" armnet 175 | 176 | ## Naming the stack 177 | To name the stack without using the directory name, create .env file in the same 178 | directory the compose file is located and add the following: 179 | COMPOSE_PROJECT_NAME=mystack 180 | Alternatively, use -p "mystack" before up. 181 | Example: docker-compose -p "mystack" up -d 182 | 183 | ## Docker compose file example 184 | This example uses version 3.8 of the [compose](https://docs.docker.com/compose/compose-file) file format. 185 | -------------------------------------------------------------------------------- /ubuntu-20.04/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Compose file for Raspberry Pi 4 2 | version: '3.8' 3 | services: 4 | # portainer 5 | portainer: 6 | image: portainer/portainer-ce 7 | container_name: portainer 8 | hostname: portainer 9 | restart: always 10 | networks: 11 | - rpinet 12 | ports: 13 | - '9000:9000' 14 | volumes: 15 | - /var/run/docker.sock:/var/run/docker.sock 16 | - /path/to/portainer/data:/data 17 | environment: 18 | - PUID=1000 19 | - PGID=1000 20 | command: 21 | -H unix:///var/run/docker.sock 22 | # adguard 23 | adguard: 24 | image: adguard/adguardhome 25 | container_name: adguardhome 26 | hostname: adguardhome 27 | restart: unless-stopped 28 | networks: 29 | macvlan: 30 | ipv4_address: 192.168.0.89 31 | volumes: 32 | - /path/to/adguardhome/work:/opt/adguardhome/work 33 | - /path/to/adguardhome/conf:/opt/adguardhome/conf 34 | environment: 35 | - PUID=1000 36 | - PGID=1000 37 | # Raspberry Pi 4 networks 38 | networks: 39 | rpinet: 40 | external: true 41 | macvlan: 42 | external: true 43 | --------------------------------------------------------------------------------