refinery-platform / django_docker_engine

Django app that manages the creation of, and proxies requests to, Docker containers.
MIT License
6 stars 2 forks source link

Get file pull from localhost working in demo on linux #143

Closed mccalluc closed 6 years ago

mccalluc commented 6 years ago

The demo is fine on Mac, but running in linux, lineup never comes up, because it can't hit the host django. I feel like I'm close, but the IP we return here doesn't work:

        lines = subprocess.check_output(
            ['ip', 'route']).decode('utf-8').splitlines()
        host_lines = [line for line in lines if 'docker0' in line]
        assert len(host_lines) == 1,\
            'Expected exactly 1 "docker0" line in {}'.format(lines)
        ip = host_lines[0].strip().split(' ')[-1]
        assert re.match(r'\d+\.\d+\.\d+\.\d+', ip),\
            'Last element not ip: {}'.format(host_lines[0])
        return ip