mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-02-03 09:48:38 +08:00
deploy image upload to dockerhub
This commit is contained in:
parent
1db322c8f6
commit
011a85368e
@ -7,6 +7,6 @@ RUN chmod +x /init_portainer
|
||||
|
||||
# step2: copy build go program to portainer
|
||||
FROM portainer/portainer-ce:2.19.0
|
||||
LABEL maintainer="Websoft9<help@websoft9.com>"
|
||||
LABEL maintainer="websoft9<help@websoft9.com>"
|
||||
LABEL version="2.19.0"
|
||||
COPY --from=builder /init_portainer /
|
@ -6,9 +6,6 @@ services:
|
||||
portainer:
|
||||
container_name: websoft9-deploy
|
||||
image: websoft9dev/deploy:2.19.0
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
entrypoint: ["/init_portainer"]
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
filePath := "/portainer_password"
|
||||
filePath := "/var/websoft9/portainer_password"
|
||||
|
||||
_, err := os.Stat(filePath)
|
||||
if os.IsNotExist(err) {
|
||||
@ -56,6 +56,13 @@ func generatePassword(length int) string {
|
||||
return string(password)
|
||||
}
|
||||
|
||||
func writeToFile(filename, content string) error {
|
||||
return ioutil.WriteFile(filename, []byte(content), 0755)
|
||||
func writeToFile(filePath , content string) error {
|
||||
if _, err := os.Stat(filePath); os.IsNotExist(err) {
|
||||
err = os.MkdirAll(filePath, 0755)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
return ioutil.WriteFile(filePath , []byte(content), 0755)
|
||||
}
|
Loading…
Reference in New Issue
Block a user