mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #5436 from hobofan/master
reapply Cmd value even if CmdAdd returns early
This commit is contained in:
commit
4b587ac118
1 changed files with 1 additions and 1 deletions
|
@ -521,6 +521,7 @@ func (b *buildFile) CmdAdd(args string) error {
|
|||
|
||||
cmd := b.config.Cmd
|
||||
b.config.Cmd = []string{"/bin/sh", "-c", fmt.Sprintf("#(nop) ADD %s in %s", orig, dest)}
|
||||
defer func(cmd []string) { b.config.Cmd = cmd }(cmd)
|
||||
b.config.Image = b.image
|
||||
|
||||
var (
|
||||
|
@ -656,7 +657,6 @@ func (b *buildFile) CmdAdd(args string) error {
|
|||
if err := b.commit(container.ID, cmd, fmt.Sprintf("ADD %s in %s", orig, dest)); err != nil {
|
||||
return err
|
||||
}
|
||||
b.config.Cmd = cmd
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue