Is it possible from Docker to modify (Add) to the host file of the HOST operating system: Windows or its equivalent in Ubuntu and create the URL and IP address entries?
I hope to be able to add dynamically in the process of executing the command:
docker-compose up -d
Note:
127.0.0.1 www.lh-2.dock lh-2.dock
127.0.0.1 www.lh-2.pma.dock lh-2.pma.dock
Try:
version: '3'
services:
myapp:
image: image_app
container_name: container_app
volumes:
- E:\Web\LH2\docker\hosts:C:\Windows\System32\drivers\etc\hosts
command: cmd /c "echo 127.0.0.1 www.lh-2.dock lh-2.dock >> C:\Windows\System32\drivers\etc\hosts && echo 127.0.0.1 www.lh-2.pma.dock lh-2.pma.dock >> C:\Windows\System32\drivers\etc\hosts && your_start_command"
and
version: '3'
services:
myapp:
image: image_app
container_name: container_app
volumes:
- /media/developer1/device/Web/LH2/docker/hosts:/etc/hosts
command: sh -c "echo '127.0.0.1 www.lh-2.dock lh-2.dock' >> /etc/hosts && echo '127.0.0.1 www.lh-2.pma.dock lh-2.pma.dock' >> /etc/hosts && tu_comando_de_inicio"
How can I merge the two environments that were deployed on Windows/Linux and let the system select the appropriate environment?