Skip to content

Commit

Permalink
fix(build, stapel, docker): /.werf/stapel/embedded/bin/bash: warning:…
Browse files Browse the repository at this point in the history
… setlocale: LC_ALL: cannot change locale

Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
  • Loading branch information
alexey-igrychev committed Oct 17, 2024
1 parent 2e5744a commit e8444ee
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/container_backend/legacy_stage_image_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"

"github.com/docker/docker/api/types"
"github.com/docker/docker/runconfig/opts"

"github.com/werf/logboek"
"github.com/werf/werf/v2/pkg/docker"
Expand Down Expand Up @@ -191,6 +192,10 @@ func (c *LegacyStageImageContainer) prepareServiceRunOptions(ctx context.Context
serviceRunOptions.Entrypoint = stapel.BashBinPath()
serviceRunOptions.User = "0:0"

// ENV
serviceRunOptions.Env["LANG"] = "C.UTF-8"
serviceRunOptions.Env["LC_ALL"] = "C.UTF-8"

stapelContainerName, err := stapel.GetOrCreateContainer(ctx)
if err != nil {
return nil, err
Expand Down Expand Up @@ -260,6 +265,14 @@ func (c *LegacyStageImageContainer) prepareInheritedCommitOptions(ctx context.Co
} else {
inheritedOptions.Workdir = "/"
}

fromImageEnv := opts.ConvertKVStringsToMap(fromImageInspect.Config.Env)
for _, k := range []string{"LANG", "LC_ALL"} {
if val, hasKey := fromImageEnv[k]; hasKey {
inheritedOptions.Env[k] = val
}
}

return inheritedOptions, nil
}

Expand Down

0 comments on commit e8444ee

Please sign in to comment.