Im trying to apply MAC VLAN network to particular Container, but Im getting an error. Can anybody help me with this? I did search for solution but nothing helped so far… Networking in docker is a bit mess…
in fact, I cant use DNS name inside my NginX proxy - they just dont work, Im thinking its cuz Im using AdguardHome, and I had to disable :53 resolver in debian to let AGH working as expetced…
I did create new Network like this:
docker network create -d macvlan --attachable --subnet 10.192.168.0/24 --gateway 10.192.168.1 --ip-range 10.192.168.168/32 -o parent=enp0s31f6 Mvlan_10.192.168.168
This is normally because you tried to change the network in the CasaOS App Settings. You should edit the Docker compose file without using the CasaOS UI.
When using Docker Compose to connect a container to a macvlan network, you should specify the network under the networks section at the bottom of your docker-compose.yml file and then reference it under the service that needs to use it.
Define the External Network in Docker Compose: Since you’ve already created the network outside of Docker Compose with the docker network create command, you’ll need to declare it as an external network in your docker-compose.yml. This tells Docker Compose that the network is defined outside the compose file and should be used as-is.
Assign the Network to Your Service: Then, you need to specify which service should be attached to this external network.
Example
version: '3.8'
services:
your_service_name: # Replace with your actual service name
image: your_image # Replace with the image you want to use
networks:
- Mvlan_10.192.168.168 # Use the name of the external network
networks:
Mvlan_10.192.168.168:
external: true
name: Mvlan_10.192.168.168 # This should match the name of the network you created
It didnt work. Im fighting with this cuz I cant use domain names inside the containers, cuz Im using ADGuard Home inside the container and I had to disable local resolver to make AGH work. I dont know who design networking in docker but was drugged