mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-02-02 17:08:38 +08:00
portainer
This commit is contained in:
parent
bc977b4ef6
commit
c16dd1e600
@ -6,7 +6,7 @@ RUN go build -o init_portainer /init_portainer.go
|
|||||||
RUN chmod +x /init_portainer
|
RUN chmod +x /init_portainer
|
||||||
|
|
||||||
# step2: copy build go program to portainer
|
# step2: copy build go program to portainer
|
||||||
# Dockerfile refer to: https://github.com/portainer/portainer/blob/develop/build/linux/Dockerfile
|
# Dockerfile refer to: https://github.com/portainer/portainer/blob/develop/build/linux/Dockerfile
|
||||||
FROM portainer/portainer-ce:2.19.0
|
FROM portainer/portainer-ce:2.19.0
|
||||||
LABEL maintainer="websoft9<help@websoft9.com>"
|
LABEL maintainer="websoft9<help@websoft9.com>"
|
||||||
LABEL version="2.19.0"
|
LABEL version="2.19.0"
|
||||||
|
@ -23,28 +23,22 @@ func main() {
|
|||||||
fmt.Println("write file error:", err)
|
fmt.Println("write file error:", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// call portainer
|
||||||
|
cmd := exec.Command("./portainer", "--admin-password-file", filePath)
|
||||||
|
cmd.Stdout = os.Stdout
|
||||||
|
cmd.Stderr = os.Stderr
|
||||||
|
|
||||||
|
err = cmd.Run()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("error running compiled_program:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
fmt.Println("credential is exist, skip it.")
|
fmt.Println("credential is exist, skip it.")
|
||||||
cmd := exec.Command("./portainer")
|
cmd := exec.Command("./portainer")
|
||||||
cmd.Run()
|
cmd.Run()
|
||||||
}
|
}
|
||||||
|
|
||||||
content, err := ioutil.ReadFile(filePath)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println("read file error:", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// call portainer
|
|
||||||
cmd := exec.Command("./portainer", "--admin-password-file", filePath)
|
|
||||||
cmd.Stdout = os.Stdout
|
|
||||||
cmd.Stderr = os.Stderr
|
|
||||||
|
|
||||||
err = cmd.Run()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println("error running compiled_program:", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func generatePassword(length int) string {
|
func generatePassword(length int) string {
|
||||||
|
Loading…
Reference in New Issue
Block a user