本文整理匯總了Golang中github.com/samalba/dockerclient.ContainerConfig.Entrypoint方法的典型用法代碼示例。如果您正苦於以下問題:Golang ContainerConfig.Entrypoint方法的具體用法?Golang ContainerConfig.Entrypoint怎麽用?Golang ContainerConfig.Entrypoint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/samalba/dockerclient.ContainerConfig
的用法示例。
在下文中一共展示了ContainerConfig.Entrypoint方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Encode
// Encode encodes the build script as a command in the
// provided Container config. For linux, the build script
// is embedded as the container entrypoint command, base64
// encoded as a one-line script.
func Encode(w *plugin.Workspace, c *dockerclient.ContainerConfig, n *parser.DockerNode) {
var buf bytes.Buffer
buf.WriteString(setupScript)
buf.WriteString(forceYesScript)
if w != nil && w.Keys != nil && w.Netrc != nil {
buf.WriteString(writeKey(
w.Keys.Private,
))
buf.WriteString(writeNetrc(
w.Netrc.Machine,
w.Netrc.Login,
w.Netrc.Password,
))
}
if len(n.Shell) > 0 {
buf.WriteString(fmt.Sprintf("%s << \"EOF\"", n.Shell))
}
buf.WriteString(writeCmds(n.Commands))
if len(n.Shell) > 0 {
buf.WriteString("EOF")
}
buf.WriteString(teardownScript)
c.Entrypoint = entrypoint
c.Cmd = []string{encode(buf.Bytes())}
}
示例2: maybeEscalate
func maybeEscalate(conf dockerclient.ContainerConfig, node *parser.DockerNode) {
if node.Image == "plugins/drone-docker" || node.Image == "plugins/drone-gcr" || node.Image == "plugins/drone-ecr" {
return
}
conf.Volumes = nil
conf.HostConfig.NetworkMode = ""
conf.HostConfig.Privileged = true
conf.Entrypoint = []string{}
conf.Cmd = []string{}
}