WORKDIR set cmd
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
8c2e674551
commit
1b97bb416b
1 changed files with 11 additions and 0 deletions
|
@ -290,6 +290,17 @@ func workdir(b *Builder, args []string, attributes map[string]bool, original str
|
|||
return nil
|
||||
}
|
||||
b.runConfig.Image = b.image
|
||||
|
||||
cmd := b.runConfig.Cmd
|
||||
b.runConfig.Cmd = strslice.StrSlice(append(getShell(b.runConfig), fmt.Sprintf("#(nop) WORKDIR %s", b.runConfig.WorkingDir)))
|
||||
defer func(cmd strslice.StrSlice) { b.runConfig.Cmd = cmd }(cmd)
|
||||
|
||||
if hit, err := b.probeCache(); err != nil {
|
||||
return err
|
||||
} else if hit {
|
||||
return nil
|
||||
}
|
||||
|
||||
container, err := b.docker.ContainerCreate(types.ContainerCreateConfig{Config: b.runConfig}, true)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue