What's the docker-compose equivalent of docker run --init?

后端 未结 2 1149
再見小時候
再見小時候 2021-01-03 22:14

According to https://github.com/krallin/tini#using-tini, tini is built into docker, and can be used by passing the --init flag to docker run. In m

相关标签:
2条回答
  • 2021-01-03 22:28

    If you are using version 2 of docker-compose, the configuration parameter is called init.

    Example:

    version: '2.2'
    services:
      web:
        image: alpine:latest
        init: /usr/libexec/docker-init
    

    Please see here for more details: https://docs.docker.com/compose/compose-file/compose-file-v2/#init

    If you're using docker-compose version 3, apparently this has been removed and returned in version 3.7. Please refer to the following ticket: https://github.com/docker/docker.github.io/issues/3149

    0 讨论(0)
  • 2021-01-03 22:41

    Here is an example from Docker Docs:

    version: "2.4"
    services:
      web:
        image: alpine:latest
        init: true
    
    0 讨论(0)
提交回复
热议问题