mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-01 03:24:14 +08:00
Fix issue with runtime environment restart failure (#8008)
This commit is contained in:
parent
5e2bb27a47
commit
1f716cb85d
@ -201,7 +201,7 @@ func (u *ContainerService) CreateCompose(req dto.ComposeCreate) error {
|
|||||||
}
|
}
|
||||||
go func() {
|
go func() {
|
||||||
taskItem.AddSubTask(i18n.GetMsgByKey("ComposeCreate"), func(t *task.Task) error {
|
taskItem.AddSubTask(i18n.GetMsgByKey("ComposeCreate"), func(t *task.Task) error {
|
||||||
cmd := exec.Command("docker-compose", "-f", req.Path, "up", "-d")
|
cmd := exec.Command("docker", "compose", "-f", req.Path, "up", "-d")
|
||||||
out, err := cmd.CombinedOutput()
|
out, err := cmd.CombinedOutput()
|
||||||
taskItem.Log(i18n.GetWithName("ComposeCreateRes", string(out)))
|
taskItem.Log(i18n.GetWithName("ComposeCreateRes", string(out)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -150,7 +150,7 @@ func runComposeCmdWithLog(operate string, composePath string, logPath string) er
|
|||||||
|
|
||||||
err = cmd.Run()
|
err = cmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New(buserr.New("ErrRuntimeStart").Error() + ":" + err.Error())
|
return errors.New(buserr.New("ErrRuntimeStart").Error() + ":" + stderrBuf.String())
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -263,7 +263,7 @@ func buildRuntime(runtime *model.Runtime, oldImageID string, oldEnv string, rebu
|
|||||||
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Hour)
|
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Hour)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
cmd := exec.CommandContext(ctx, "docker-compose", "-f", composePath, "build")
|
cmd := exec.CommandContext(ctx, "docker", "compose", "-f", composePath, "build")
|
||||||
cmd.Stdout = logFile
|
cmd.Stdout = logFile
|
||||||
var stderrBuf bytes.Buffer
|
var stderrBuf bytes.Buffer
|
||||||
multiWriterStderr := io.MultiWriter(&stderrBuf, logFile)
|
multiWriterStderr := io.MultiWriter(&stderrBuf, logFile)
|
||||||
|
@ -306,6 +306,7 @@ const message = {
|
|||||||
installerr: 'Installation failed',
|
installerr: 'Installation failed',
|
||||||
applyerror: 'Apply failed',
|
applyerror: 'Apply failed',
|
||||||
systemrestart: 'Interrupted',
|
systemrestart: 'Interrupted',
|
||||||
|
starterr: 'Startup failed',
|
||||||
},
|
},
|
||||||
units: {
|
units: {
|
||||||
second: 'Second',
|
second: 'Second',
|
||||||
|
@ -300,6 +300,7 @@ const message = {
|
|||||||
installerr: 'インストールに失敗しました',
|
installerr: 'インストールに失敗しました',
|
||||||
applyerror: '適用に失敗しました',
|
applyerror: '適用に失敗しました',
|
||||||
systemrestart: '中断',
|
systemrestart: '中断',
|
||||||
|
starterr: '起動に失敗しました',
|
||||||
},
|
},
|
||||||
units: {
|
units: {
|
||||||
second: '2番目|2番目|秒',
|
second: '2番目|2番目|秒',
|
||||||
|
@ -301,6 +301,7 @@ const message = {
|
|||||||
installerr: '설치 실패',
|
installerr: '설치 실패',
|
||||||
applyerror: '적용 실패',
|
applyerror: '적용 실패',
|
||||||
systemrestart: '중단됨',
|
systemrestart: '중단됨',
|
||||||
|
starterr: '시작 실패',
|
||||||
},
|
},
|
||||||
units: {
|
units: {
|
||||||
second: '초 | 초 | 초',
|
second: '초 | 초 | 초',
|
||||||
|
@ -307,6 +307,7 @@ const message = {
|
|||||||
installerr: 'Pemasangan gagal',
|
installerr: 'Pemasangan gagal',
|
||||||
applyerror: 'Permohonan gagal',
|
applyerror: 'Permohonan gagal',
|
||||||
systemrestart: 'Dihentikan',
|
systemrestart: 'Dihentikan',
|
||||||
|
starterr: 'Permulaan gagal',
|
||||||
},
|
},
|
||||||
units: {
|
units: {
|
||||||
second: 'saat | saat | saat',
|
second: 'saat | saat | saat',
|
||||||
|
@ -305,6 +305,7 @@ const message = {
|
|||||||
installerr: 'Falha na instalação',
|
installerr: 'Falha na instalação',
|
||||||
applyerror: 'Falha na aplicação',
|
applyerror: 'Falha na aplicação',
|
||||||
systemrestart: 'Interrompido',
|
systemrestart: 'Interrompido',
|
||||||
|
starterr: 'Falha na inicialização',
|
||||||
},
|
},
|
||||||
units: {
|
units: {
|
||||||
second: 'segundo | segundos | segundos',
|
second: 'segundo | segundos | segundos',
|
||||||
|
@ -301,6 +301,7 @@ const message = {
|
|||||||
installerr: 'Ошибка установки',
|
installerr: 'Ошибка установки',
|
||||||
applyerror: 'Ошибка применения',
|
applyerror: 'Ошибка применения',
|
||||||
systemrestart: 'Прервано',
|
systemrestart: 'Прервано',
|
||||||
|
starterr: 'Ошибка запуска',
|
||||||
},
|
},
|
||||||
units: {
|
units: {
|
||||||
second: ' секунда | секунда | секунд',
|
second: ' секунда | секунда | секунд',
|
||||||
|
@ -300,6 +300,7 @@ const message = {
|
|||||||
installerr: '安裝失敗',
|
installerr: '安裝失敗',
|
||||||
applyerror: '申請失敗',
|
applyerror: '申請失敗',
|
||||||
systemrestart: '中斷',
|
systemrestart: '中斷',
|
||||||
|
starterr: '啟動失敗',
|
||||||
},
|
},
|
||||||
units: {
|
units: {
|
||||||
second: '秒',
|
second: '秒',
|
||||||
|
@ -298,6 +298,7 @@ const message = {
|
|||||||
installerr: '安装失败',
|
installerr: '安装失败',
|
||||||
applyerror: '申请失败',
|
applyerror: '申请失败',
|
||||||
systemrestart: '中断',
|
systemrestart: '中断',
|
||||||
|
starterr: '启动失败',
|
||||||
},
|
},
|
||||||
units: {
|
units: {
|
||||||
second: '秒',
|
second: '秒',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user