2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00

feat: 优化docker兼容

This commit is contained in:
耗子
2024-10-31 03:28:41 +08:00
parent 52e8830605
commit f01afacf34
13 changed files with 107 additions and 49 deletions

View File

@@ -84,17 +84,17 @@ func (r *containerVolumeRepo) Create(req *request.ContainerVolumeCreate) (string
sb.WriteString(fmt.Sprintf(" --opt %s=%s", option.Key, option.Value))
}
return shell.ExecfWithTimeout(30*time.Second, sb.String()) // nolint: govet
return shell.ExecfWithTimeout(120*time.Second, sb.String()) // nolint: govet
}
// Remove 删除存储卷
func (r *containerVolumeRepo) Remove(id string) error {
_, err := shell.ExecfWithTimeout(30*time.Second, "docker volume rm -f %s", id)
_, err := shell.ExecfWithTimeout(120*time.Second, "docker volume rm -f %s", id)
return err
}
// Prune 清理未使用的存储卷
func (r *containerVolumeRepo) Prune() error {
_, err := shell.ExecfWithTimeout(30*time.Second, "docker volume prune -f")
_, err := shell.ExecfWithTimeout(120*time.Second, "docker volume prune -f")
return err
}