Skip to content

Commit

Permalink
cmdio/ctr: Do not pass PWD variable into container
Browse files Browse the repository at this point in the history
  • Loading branch information
lesiw committed Oct 13, 2024
1 parent dd79312 commit 588b24c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ctr/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ func (c *cmd) setCmd(attach bool) {
if attach {
cmd = append(cmd, "-t")
}
if c.env["PWD"] != "" {
cmd = append(cmd, "-w", c.env["PWD"])
}
for k, v := range c.env {
cmd = append(cmd, "-e", k+"="+v)
if k == "PWD" {
cmd = append(cmd, "-w", c.env["PWD"])
} else {
cmd = append(cmd, "-e", k+"="+v)
}
}
cmd = append(cmd, c.cdr.ctrid)
cmd = append(cmd, c.arg...)
Expand Down

0 comments on commit 588b24c

Please sign in to comment.