Commit 2370ba5a authored by Ernesto Rodriguez Ortiz's avatar Ernesto Rodriguez Ortiz
Browse files

Update the variable env.container_ip when the container start

parent 587925b4
......@@ -35,7 +35,9 @@ env.docker_workspace = '/opt/sfl'
env.docker_site_root = '{}/src/drupal'.format(env.docker_workspace)
env.bind_port = 8001
env.apache_user = 'www-data'
env.container_ip = '172.0.0.0'
# Docker auto-added container IP
env.container_ip = '172.17.0.0'
# Hook commands
......
......@@ -127,7 +127,7 @@ def fab_update_container_ip():
container_ip = fab_run('local', 'docker inspect -f "{{{{.NetworkSettings.IPAddress}}}}" '
'{}_container'.format(env.project_name), capture=True)
env.container_ip = container_ip
local('sed -i "/env.container_ip/d" {}/local_vars.py'.format(os.path.dirname(os.path.abspath(__file__))))
local('sed -i "/# Docker auto-added container IP/a env.container_ip = \'{}\'" {}/local_vars.py'.format(''.join(container_ip), os.path.dirname(os.path.abspath(__file__))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment