mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-06 05:24:33 +08:00
fix: 解决 Docker 版本过低导致应用无法操作的问题 (#1446)
Refs https://github.com/1Panel-dev/1Panel/issues/1445
This commit is contained in:
parent
62becf819d
commit
efe185e5dc
1 changed files with 6 additions and 6 deletions
|
@ -5,31 +5,31 @@ import (
|
|||
)
|
||||
|
||||
func Up(filePath string) (string, error) {
|
||||
stdout, err := cmd.Execf("docker compose -f %s up -d", filePath)
|
||||
stdout, err := cmd.Execf("docker-compose -f %s up -d", filePath)
|
||||
return stdout, err
|
||||
}
|
||||
|
||||
func Down(filePath string) (string, error) {
|
||||
stdout, err := cmd.Execf("docker compose -f %s down --remove-orphans", filePath)
|
||||
stdout, err := cmd.Execf("docker-compose -f %s down --remove-orphans", filePath)
|
||||
return stdout, err
|
||||
}
|
||||
|
||||
func Start(filePath string) (string, error) {
|
||||
stdout, err := cmd.Execf("docker compose -f %s start", filePath)
|
||||
stdout, err := cmd.Execf("docker-compose -f %s start", filePath)
|
||||
return stdout, err
|
||||
}
|
||||
|
||||
func Stop(filePath string) (string, error) {
|
||||
stdout, err := cmd.Execf("docker compose -f %s stop", filePath)
|
||||
stdout, err := cmd.Execf("docker-compose -f %s stop", filePath)
|
||||
return stdout, err
|
||||
}
|
||||
|
||||
func Restart(filePath string) (string, error) {
|
||||
stdout, err := cmd.Execf("docker compose -f %s restart", filePath)
|
||||
stdout, err := cmd.Execf("docker-compose -f %s restart", filePath)
|
||||
return stdout, err
|
||||
}
|
||||
|
||||
func Operate(filePath, operation string) (string, error) {
|
||||
stdout, err := cmd.Execf("docker compose -f %s %s", filePath, operation)
|
||||
stdout, err := cmd.Execf("docker-compose -f %s %s", filePath, operation)
|
||||
return stdout, err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue