Finds suitable IP from ifconfig
and then distribute this IP into hosts and docker file and allows revert changes.
composer require --dev mf/docker-ip
vendor/bin/docker-ip-console list
vendor/bin/docker-ip-console [command] [arguments]
help Displays help for a command
list Lists commands
docker-ip
docker-ip:distributeIpToHost Finds suitable IP from `ifconfig` and then distribute this IP into hosts and docker file
docker-ip:revert Reverts changes from `distributeIpToHost` in hosts and docker file
Finds suitable IP from ifconfig
and then distribute this IP into hosts and docker file.
vendor/bin/docker-ip-console docker-ip:distributeIpToHost [options]
-d, --domain=DOMAIN Your local domain
--docker-file=DOCKER-FILE Full path to your docker compose yml
--hosts[=HOSTS] Full path to your hosts file [default: "/etc/hosts"]
-p, --placeholder[=PLACEHOLDER] Placeholder used in DOCKER_FILE [default: "DOCKER_IP_PLACEHOLDER"]
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
127.0.0.1 your_domain
extra_hosts:
- "your_domain:DOCKER_IP_PLACEHOLDER"
Reverts changes from distributeIpToHost
in hosts and docker file
vendor/bin/docker-ip-console docker-ip:revert [options]
--docker-file=DOCKER-FILE Full path to your docker compose yml
--hosts[=HOSTS] Full path to your hosts file [default: "/etc/hosts"]
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
#REPLACED_BY_DOCKER_IP 127.0.0.1 your_domain
{DOCKER_IP} your_domain
extra_hosts:
#REPLACED_BY_DOCKER_IP - "your_domain:DOCKER_IP_PLACEHOLDER"
- "your_domain:{DOCKER_IP}"