portainer

This commit is contained in:
qiaofeng1227 2024-12-06 16:29:20 +08:00
parent 0220641c0c
commit 5528e054cd
2 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# modify time: 202407291102, you can modify here to trigger Docker Build action
# modify time: 202412061629, you can modify here to trigger Docker Build action
# step1: Build entrypoint execute program init_portainer by golang
FROM golang:latest AS builder

View File

@ -31,7 +31,7 @@ type Credentials struct {
}
func main() {
// 检查初始化标志文件是否存在
initFlagExists := fileExists(initFlagFilePath)
credentialFileExists := fileExists(credentialFilePath)
@ -82,6 +82,13 @@ func main() {
}
}
func fileExists(filePath string) bool {
if _, err := os.Stat(filePath); err == nil {
return true
}
return false
}
func startPortainer() {
cmd := exec.Command("/portainer")
cmd.Stdout = os.Stdout