The following explains how to prevent Docker from creating a network with a specific IP address range. When the docker network create command is run, it looks for any ranges that appear to be in use and then excludes those ranges from candidate ranges when determining what to use. There are a few things taken into consideration when determining if a particular range is 'in use' or not.
version: '3.3' |
services: |
db: |
image: mysql:5.7 |
volumes: |
- db_data:/var/lib/mysql |
restart: always |
networks: |
- myvlan |
environment: |
MYSQL_ROOT_PASSWORD: wordpress |
MYSQL_DATABASE: wordpress |
MYSQL_USER: wordpress |
MYSQL_PASSWORD: wordpress |
wordpress: |
depends_on: |
- db |
image: wordpress:latest |
ports: |
- '8000:80' |
restart: always |
networks: |
- myvlan |
environment: |
WORDPRESS_DB_HOST: db:3306 |
WORDPRESS_DB_PASSWORD: wordpress |
volumes: |
db_data: |
networks: |
private: |
myvlan: |
driver: macvlan |
driver_opts: |
parent: ens160.30 |
ipam: |
config: |
- subnet: 100.98.26.0/24 |
I get this error |
what is parent: ens160.30 under driver_opts referencing? that's the docker host's NIC to VLAN? |
@moesphemie: Ensure there is a network interface called @eugenepark1: I guess this is the host's sub interface which is also in Regards, |
I am pulling my hair on the same issue (kind of). When ever I start docker compose, the message I get is: ERROR: The Compose file '/root/docker/docker-compose-macvlan.yml' is invalid because: I am using 3.6, and I am using the same syntax as the OP. And yes, I am using the correct interface: qbittorrent: Any pointers would be greatly appreciated! |
@kcallis notice the very first line in the compose file, the version matters. |
followed this code but error popup: |