docker-compose : Why agent & app service fail due to hostname?

后端 未结 3 444
深忆病人
深忆病人 2021-01-23 19:36

Below is the working docker-compose file in v2 spec:

version: \'2\'

volumes:
  webroot:
    driver: local


services:
  app: # Launch uwsgi application server
          


        
3条回答
  •  太阳男子
    2021-01-23 20:03

    that is how Docker works because the hostname is not unique and that will lead to a problem if you give two containers the same hostname therefore compose will always use the service name for DNS resolution

提交回复
热议问题