How do I set hostname in docker-compose?

后端 未结 8 2249
清酒与你
清酒与你 2020-11-29 18:11

In my docker-compose.yml file, I have the following. However the container does not pick up the hostname value. Any ideas?

dns:
  image: phensle         


        
8条回答
  •  情话喂你
    2020-11-29 19:00

    As of docker-compose version 3 and later, you can just use the hostname key:

    version: '3'
    services:
      dns:
        hostname: 'your-name'
    

提交回复
热议问题