2017-06-08 50 views
1

容器我有docker-compose問題,不能創建服務postgresqlredis容器,我跑docker-compose up -d後,我得到這個錯誤:泊塢窗撰寫不能創建PostgreSQL和Redis的

ERROR: for dockerizingdjango_postgres_1 Cannot create container for service postgres: b'invalid port specification: "None"' 
Creating dockerizingdjango_redis_1 ... 
Creating dockerizingdjango_redis_1 ... error 
ERROR: for dockerizingdjango_redis_1 Cannot create container for service redis: b'invalid port specification: "None"' 
ERROR: for postgres Cannot create container for service postgres: b'invalid port specification: "None"' 
ERROR: for redis Cannot create container for service redis: b'invalid port specification: "None"' 
ERROR: Encountered errors while bringing up the project. 

docker-compose.yml文件看起來像這樣:

web: 
    restart: always 
    build: ./web 
    expose: 
    - "8000" 
    links: 
    - postgres:postgres 
    - redis:redis 
    volumes: 
    - /usr/src/app 
    - /usr/src/app/static 
    env_file: .env 
    environment: 
    DEBUG: 'true' 
    command: /usr/local/bin/gunicorn docker_django.wsgi:application -w 2 -b :8000 

apache: 
    restart: always 
    build: ./apache/ 
    ports: 
    - "80:80" 
    volumes: 
    - /www/static 
    - /www/media 
    volumes_from: 
    - web 
    links: 
    - web:web 

postgres: 
    restart: always 
    image: postgres:latest 
    ports: 
    - "5432:5432" 
    volumes: 
    - pgdata:/var/lib/postgresql/data/ 

redis: 
    restart: always 
    image: redis:latest 
    ports: 
    - "6379:6379" 
    volumes: 
    - redisdata:/data 

我使用這個版本的docker-compose

docker-compose version 1.13.0, build 1719ceb 
docker-py version: 2.3.0 
CPython version: 3.4.3 
OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014 

另外我對這個容器使用python3.5,因爲我在這個容器中服務django,所以有人可以幫我解釋一下這裏發生了什麼,以及如何解決這個問題,謝謝。

+1

您是否看到此問題? https://github.com/docker/compose/issues/4729 – papey

回答