Skip to content

Commit

Permalink
WORKDIR set cmd
Browse files Browse the repository at this point in the history
Signed-off-by: John Howard <[email protected]>
  • Loading branch information
John Howard committed Nov 28, 2016
1 parent 8c2e674 commit 1b97bb4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions builder/dockerfile/dispatchers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1b97bb4

Please sign in to comment.