Open kevinquillen opened 5 years ago
I'm not sure this is the right place to ask this question since (most likely) this is not specific to docker4drupal. Considering docker provides documentation on how to use a different IP range then docker-compose probably supports it as well, my guess is that some additional configuration required in traefik. Try localizing the issue and figuring out what exactly doesn't work, if that's traefik then ask this question in their repository.
Sorry, I am new to Docker and trying to transition out of Lando.
It seems that Docker Compose will not inherit settings from Docker Engine unless you explicitly declare configuration in the compose file - this is the source of my problems and you are right, this is a Docker Compose issue and not Docker4Drupal, but probably worth mentioning here.
I had to add this to the bottom of my docker-compose.yml file:
networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.20.1.5/24
Then, in traefik.yml, I removed the networks
section and changed the config to:
services:
traefik:
image: traefik
restart: unless-stopped
command: -c /dev/null --web --docker --logLevel=DEBUG
networks:
- default
ports:
- '80:80'
- '8080:8080'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
Now I get the IPs I want to have, and do not have a network collision anymore.
So question, do we actually need traefik.yml? What is this file for? That wasn't clear to me in the documentation.
traefik.yml
used to run multiple projects on the same port
Codebase Built-in
Describe your issue I am using Docker for Mac 2.0.0.2.
I want to set the internal IP of the containers to not be on 172.x.x.x. According to the documentation I can do this by setting the subnet and bip/fixd-cidr in Dockers
daemon.json
file or from the configuration UI of the software.I was able to get an IP assigned just once for Docker4Drupal to be
192.168.32.x
- subsequent retries have resulted in only172.x.x.x
no matter what I do.I have tried pruning and killing containers and starting over multiple times.
I need to avoid using 172.x.x.x IP internally because we have various internal network services in the office that resolve to those IPs. When trying to make the application talk to those services to fetch data, it fails because the DNS returns an IP that the container cannot resolve. It works if it does not use
172.x.x.x
IP.Where in the
docker-compose.yml
ortraefik.yml
can I override or figure out why Docker4Drupal won't adhere to the settings in the Docker for Mac application?A screenshot for reference is included.
Output of
docker info
Contents of your
docker-compose.yml
traefik.yml:
This was the only time I was able to not get an assigned IP of
172.x.x.x
.