我尝试使用docker-compose.yml文件构建容器:
version: '2'
services:
     geonode:
        build: 
            context: .
        hostname: geonode
        container_name: geonode
        ports:
            - 8000:8000
        volumes:
            - .:/geonode/
        entrypoint:
            - /usr/bin/python
        command: manage.py runserver 0.0.0.0:8000
        network_mode: host
在我Dockerfile我跑apt-get update后FROM ubuntu:14.04,但它失败:Could not resolve 'archive.ubuntu.com'
我尝试docker run -i -t --net=host ubuntu:14.04 /bin/bash然后运行apt-get update它的工作原理.所以在我看来,docker-compose中的network_mode和--net=hostdocker run的运行方式不同.
有人有解释吗?