{{indexmenu_n>4}} \\
Warning | |
Do not uninstall the openmediavault-sharerootfs plugin. It is a dependency of the openmediavault-compose plugin. Uninstalling openmediavault-sharerootfs when the openmediavault-compose plugin is installed will cause the openmediavault-compose plugin to be uninstalled. |
Notes | |
This folder will store docker's internal working files, images, containers, etc. You do not need to back up this folder, it does not store any information that should be persistent. The default path is ''/var/lib/docker'' on the OMV system disk. If OMV is installed on a USB flash drive it is recommended to choose a different location to avoid excessive writing to this drive. Choosing a different disk will help prevent the system disk from filling up, which would cause OMV to malfunction. |
Note | |
In the Add from example button there is a file prepared to generate a Composerize container, which will generate yaml files from docker CLI container generation commands. |
Note | |
At this time, the plug-in backup utility does not resolve variables in volume paths. Define paths using global environment variables only for paths that you do not need to include in a backup. Alternatively you can use symlinks in the compose file. |
Note | |
There are two example Portainer yaml files: - The first one is called portainer, it is a standard file to do a fresh installation of Portainer at any time. You should not select this file in this case. - The second one is called portainer-omvextras, this yaml file has been included expressly for this plugin update, so it is already pre-configured so that Portainer continues to work in the same state before the update. This is the file you should select. |
Note | |
This file extracts the Portainer Community Edition image, which is used by most people. If you upgraded to Business Edition replace the line image: portainer/portainer-ce:latest to image: portainer/portainer-ee:latest |
Note | |
This is not an ideal situation, the generated file contains information that is not necessary and can prevent the container from running in some cases. You must locate the errors and correct them. |
Notes | |
- Portainer is just a tool to manage other containers, it's just another container. The operation of Portainer is independent of the operation of other containers. - The openmediavault-compose plugin provides the necessary functionality to deploy and manage any container, including Portainer. - Containers deployed from the Portainer GUI using docker-compose will not be able to be managed from the openmediavault-compose GUI. - Containers deployed from the openmediavault-compose GUI will not be able to be managed from the Portainer GUI. - Given the functionality provided by the openmediavault-compose plugin, it is recommended to get rid of Portainer and manage all containers from the openmediavault-compose GUI. Managing from the plugin makes things much simpler and has added benefits. |
services:
pi-hole:
container_name: "pi-hole"
.
.
networks:
mynet:
ipv4_address: 192.168.1.241
networks:
mynet:
external: true
This sets up the mynet interface for that container and assigns it the IP value ''192.168.1.241'' within our network, which was the first available. We will still be able to use up to ''246'' in other containers.
When we start the container we will be able to access its interface from the assigned IP and the usual port.
----
== Reduce the IP range of the DHCP server (usually the router) ==
Once the above is done, in order to avoid overlapping assignable IP ranges, it would be advisable to reduce the IP range of the network's DHCP server.
In the case of the previous configuration it could be set to:
* From 192.168.1.2
* Up to 192.168.1.239
This way addresses from 192.168.1.240 onwards will always be available, since the router will not assign any of these IPs if a device requests an IP assignment.
If you use the container itself as a DHCP server, for example with pi-hole, you must disable the DHCP server on your router and adapt the DHCP range in pi-hole accordingly.
----
== If we need communication between the containers and the host ==
What has been applied so far is enough to use pihole, but in the case of other different containers it may be necessary for the container and the host to communicate with each other. Vlans have a limitation, by design they cannot communicate with the host. To overcome this setback and allow communication between the containers and the host, if necessary, we can create a network interface that will act as a bridge between the two.
Warning | |
This procedure creates a binding interface for communication with the host via /etc/network/interfaces when OMV is using netplan. This can generate some conflict in certain circumstances. Do it at your own risk. If you have a suggestion to do this in a safe way you can post it in the forum. |
ip link add mynet-host link eno1 type macvlan mode bridge
ip addr add 192.168.1.239/32 dev mynet-host
ip link set mynet-host up
ip route add 192.168.1.224/28 dev mynet-host
This would create a macvlan network interface called mynet-host in bridge mode that would use the IP ''192.168.1.239''. The host would use this network interface thanks to the static route set in the ''192.168.1.224/28'' network range to communicate with the containers.
To make this configuration persistent in OMV we must do it as follows:
* Create a network interface configuration file:
nano /etc/network/interfaces.d/99-mynet-host
* Copy into that file the following content:
auto mynet-host
iface mynet-host inet static
pre-up ip link add mynet-host link eno1 type macvlan mode bridge
address 192.168.1.239/32
up ip link set mynet-host up
up ip route add 192.168.1.224/28 dev mynet-host
* Replace ''eno1'' with your network interface. You can see it in the GUI under **Network** > **Interfaces**.
* Save changes and exit the editor. ''Ctrl+X'' and ''Yes''
* Restart the service or the server.
From now on those settings will be set every time the server is started.
Note | |
If for some reason you need to create many different IPs keep in mind that macvlan uses different MAC addresses for each IP. This can be a problem if your hardware has a limit on the maximum number of MACs for the same physical interface. In that case you can change the configuration to ipvlan. Consult the official docker documentation in this regard to solve other possible configuration problems with ipvlan. |