Remove run from the ADD instruction
This commit is contained in:
parent
b38c6929be
commit
d0084ce5f2
|
@ -220,12 +220,15 @@ func (b *buildFile) CmdAdd(args string) error {
|
||||||
|
|
||||||
cmd := b.config.Cmd
|
cmd := b.config.Cmd
|
||||||
b.config.Cmd = []string{"/bin/sh", "-c", fmt.Sprintf("#(nop) ADD %s in %s", orig, dest)}
|
b.config.Cmd = []string{"/bin/sh", "-c", fmt.Sprintf("#(nop) ADD %s in %s", orig, dest)}
|
||||||
cid, err := b.run()
|
|
||||||
|
// Create the container and start it
|
||||||
|
c, err := b.builder.Create(b.config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
b.tmpContainers[c.ID] = struct{}{}
|
||||||
|
|
||||||
container := b.runtime.Get(cid)
|
container := b.runtime.Get(c.ID)
|
||||||
if container == nil {
|
if container == nil {
|
||||||
return fmt.Errorf("Error while creating the container (CmdAdd)")
|
return fmt.Errorf("Error while creating the container (CmdAdd)")
|
||||||
}
|
}
|
||||||
|
@ -244,7 +247,7 @@ func (b *buildFile) CmdAdd(args string) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := b.commit(cid, cmd, fmt.Sprintf("ADD %s in %s", orig, dest)); err != nil {
|
if err := b.commit(c.ID, cmd, fmt.Sprintf("ADD %s in %s", orig, dest)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
b.config.Cmd = cmd
|
b.config.Cmd = cmd
|
||||||
|
|
Loading…
Reference in New Issue