diff --git a/backend/app/service/app_utils.go b/backend/app/service/app_utils.go index f9df2202e..42d8b5cf5 100644 --- a/backend/app/service/app_utils.go +++ b/backend/app/service/app_utils.go @@ -248,7 +248,7 @@ func getContainerNames(install model.AppInstall) ([]string, error) { if err != nil { return nil, err } - project, err := composeV2.GetComposeProject(install.Name, install.GetPath(), []byte(install.DockerCompose), []byte(envStr)) + project, err := composeV2.GetComposeProject(install.Name, install.GetPath(), []byte(install.DockerCompose), []byte(envStr), true) if err != nil { return nil, err } @@ -400,7 +400,7 @@ func getServiceFromInstall(appInstall model.AppInstall) (service *composeV2.Comp if err != nil { return } - project, err = composeV2.GetComposeProject(appInstall.Name, appInstall.GetPath(), []byte(appInstall.DockerCompose), []byte(envStr)) + project, err = composeV2.GetComposeProject(appInstall.Name, appInstall.GetPath(), []byte(appInstall.DockerCompose), []byte(envStr), true) if err != nil { return } diff --git a/backend/app/service/runtime.go b/backend/app/service/runtime.go index 3f572ae14..0bb3b8a74 100644 --- a/backend/app/service/runtime.go +++ b/backend/app/service/runtime.go @@ -90,7 +90,7 @@ func (r *RuntimeService) Create(create request.RuntimeCreate) (err error) { if err != nil { return } - composeService, err := getComposeService(create.Name, newNameDir, composeContent, envContent) + composeService, err := getComposeService(create.Name, newNameDir, composeContent, envContent, false) if err != nil { return } @@ -239,7 +239,7 @@ func (r *RuntimeService) Update(req request.RuntimeUpdate) error { if err != nil { return err } - composeService, err := getComposeService(runtime.Name, runtimeDir, composeContent, envContent) + composeService, err := getComposeService(runtime.Name, runtimeDir, composeContent, envContent, false) if err != nil { return err } diff --git a/backend/app/service/runtime_utils.go b/backend/app/service/runtime_utils.go index b3ca62403..144242410 100644 --- a/backend/app/service/runtime_utils.go +++ b/backend/app/service/runtime_utils.go @@ -65,8 +65,8 @@ func handleParams(image, runtimeType, runtimeDir string, params map[string]inter return } -func getComposeService(name, runtimeDir string, composeFile, env []byte) (*docker.ComposeService, error) { - project, err := docker.GetComposeProject(name, runtimeDir, composeFile, env) +func getComposeService(name, runtimeDir string, composeFile, env []byte, skipNormalization bool) (*docker.ComposeService, error) { + project, err := docker.GetComposeProject(name, runtimeDir, composeFile, env, skipNormalization) if err != nil { return nil, err } diff --git a/backend/utils/docker/compose.go b/backend/utils/docker/compose.go index d578e87b6..96d875691 100644 --- a/backend/utils/docker/compose.go +++ b/backend/utils/docker/compose.go @@ -88,7 +88,7 @@ func (s *ComposeService) ComposeBuild() error { return s.Build(context.Background(), s.project, api.BuildOptions{}) } -func GetComposeProject(projectName, workDir string, yml []byte, env []byte) (*types.Project, error) { +func GetComposeProject(projectName, workDir string, yml []byte, env []byte, skipNormalization bool) (*types.Project, error) { var configFiles []types.ConfigFile configFiles = append(configFiles, types.ConfigFile{ Filename: "docker-compose.yml", @@ -106,7 +106,7 @@ func GetComposeProject(projectName, workDir string, yml []byte, env []byte) (*ty project, err := loader.Load(details, func(options *loader.Options) { options.SetProjectName(projectName, true) options.ResolvePaths = true - options.SkipNormalization = true + options.SkipNormalization = skipNormalization }) if err != nil { return nil, err