Skip to content

Commit

Permalink
Merge pull request #380 from fahedouch/fix-set-path-env-auto-follow
Browse files Browse the repository at this point in the history
follow-up fix image PATH
  • Loading branch information
AkihiroSuda committed Sep 21, 2021
2 parents be79a84 + 1fe4ea5 commit 847d40b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/nerdctl/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,10 @@ func generateRootfsOpts(ctx context.Context, client *containerd.Client, cliconte
containerd.WithNewSnapshot(id, ensured.Image),
containerd.WithImageStopSignal(ensured.Image, "SIGTERM"),
)

if len(ensured.ImageConfig.Env) == 0 {
opts = append(opts, oci.WithDefaultPathEnv)
}
for ind, env := range ensured.ImageConfig.Env {
if strings.HasPrefix(env, "PATH=") {
break
Expand Down

0 comments on commit 847d40b

Please sign in to comment.