docker-compose image named: “prefix_%s_1” instead of “%s”

后端 未结 4 714
情话喂你
情话喂你 2021-02-05 01:29

When I set up a couple of Docker containers in docker-compose.yaml file with links, the name of the containers ends up being of the format prefix_%s_1

4条回答
  •  名媛妹妹
    2021-02-05 02:10

    You could just set container name to what you want via container_name:

    redis:
        build: ../storage/redis
        container_name: redis
        ports:
          - "6379:6379"
    

    And container hostname could also be set via hostname.

提交回复
热议问题