fix entrypoint without cmd
This commit is contained in:
parent
a37b42b57c
commit
0f249c85ea
2 changed files with 6 additions and 2 deletions
|
@ -38,7 +38,9 @@ func (builder *Builder) Create(config *Config) (*Container, error) {
|
|||
MergeConfig(config, img.Config)
|
||||
}
|
||||
|
||||
if config.Cmd == nil || len(config.Cmd) == 0 {
|
||||
if len(config.Entrypoint) != 0 && config.Cmd == nil {
|
||||
config.Cmd = []string{}
|
||||
} else if config.Cmd == nil || len(config.Cmd) == 0 {
|
||||
return nil, fmt.Errorf("No command specified")
|
||||
}
|
||||
|
||||
|
|
|
@ -93,6 +93,8 @@ func (b *buildFile) CmdRun(args string) error {
|
|||
b.config.Cmd = nil
|
||||
MergeConfig(b.config, config)
|
||||
|
||||
defer func(cmd []string) { b.config.Cmd = cmd }(cmd)
|
||||
|
||||
utils.Debugf("Command to be executed: %v", b.config.Cmd)
|
||||
|
||||
if b.utilizeCache {
|
||||
|
@ -115,7 +117,7 @@ func (b *buildFile) CmdRun(args string) error {
|
|||
if err := b.commit(cid, cmd, "run"); err != nil {
|
||||
return err
|
||||
}
|
||||
b.config.Cmd = cmd
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue