Which Docker template values are available in docker stack deploy (compose)?

爷,独闯天下 提交于 2019-12-06 08:38:01

I believe that context.go in the swarmkit repo is responsible.

This means you have the following:

    Service struct {
        ID     string
        Name   string
        Labels map[string]string
    }

    Node struct {
        ID       string
        Hostname string
        Platform Platform
    }

    Task struct {
        ID   string
        Name string
        Slot string
    }

e.g. .Service.ID,.Service.Labels.LabelNameGoesHere, .Task.Name etc.

I was hoping that the Node labels would be exposed and accessible for the templating the docker-compose.yml, but alas not.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!