當前位置: 首頁>>代碼示例>>Golang>>正文


Golang ContainerConfig.Entrypoint方法代碼示例

本文整理匯總了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())}
}
開發者ID:fracting,項目名稱:drone-exec,代碼行數:35,代碼來源:script.go

示例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{}
}
開發者ID:fracting,項目名稱:drone-exec,代碼行數:10,代碼來源:build.go


注:本文中的github.com/samalba/dockerclient.ContainerConfig.Entrypoint方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。