Skip to content

Commit

Permalink
websoft9
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaofeng1227 committed Dec 6, 2024
1 parent 2f7e4bf commit 0220641
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker/deployment/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN chmod +x /init_portainer
# Dockerfile refer to: https://github.com/portainer/portainer/blob/develop/build/linux/Dockerfile
FROM portainer/portainer-ce:2.20.3
LABEL maintainer="websoft9<help@websoft9.com>"
LABEL version="2.20.3"
LABEL version="2.20.3-rc1"
COPY --from=builder /init_portainer /

ENTRYPOINT ["/init_portainer"]
9 changes: 6 additions & 3 deletions docker/deployment/init_portainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ type Credentials struct {
}

func main() {
// 检查初始化标志文件是否存在
if _, err := os.Stat(initFlagFilePath); err == nil {
log.Println("Initialization has already been completed by another instance.")

initFlagExists := fileExists(initFlagFilePath)
credentialFileExists := fileExists(credentialFilePath)

if initFlagExists || credentialFileExists {
log.Println("Initialization has already been completed by another instance or credentials are present.")
startPortainer()
return
}
Expand Down

0 comments on commit 0220641

Please sign in to comment.