Skip to content

Commit

Permalink
portainer
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaofeng1227 committed Dec 6, 2024
1 parent 0220641 commit 5528e05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker/deployment/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 8 additions & 1 deletion docker/deployment/init_portainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type Credentials struct {
}

func main() {

// 检查初始化标志文件是否存在
initFlagExists := fileExists(initFlagFilePath)
credentialFileExists := fileExists(credentialFilePath)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5528e05

Please sign in to comment.