mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-08 15:01:42 +00:00
builder: some small fixups + fix a bug where empty entrypoints would not override inheritance.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
This commit is contained in:
committed by
Tibor Vass
parent
3d287811d7
commit
7f8cdeb18b
@@ -195,7 +195,7 @@ func run(b *Builder, args []string, attributes map[string]bool, original string)
|
||||
|
||||
defer func(cmd []string) { b.Config.Cmd = cmd }(cmd)
|
||||
|
||||
log.Debugf("Command to be executed: %v", b.Config.Cmd)
|
||||
log.Debugf("[BUILDER] Command to be executed: %v", b.Config.Cmd)
|
||||
|
||||
hit, err := b.probeCache()
|
||||
if err != nil {
|
||||
@@ -261,14 +261,14 @@ func entrypoint(b *Builder, args []string, attributes map[string]bool, original
|
||||
parsed := handleJsonArgs(args, attributes)
|
||||
|
||||
switch {
|
||||
case len(parsed) == 0:
|
||||
// ENTYRPOINT []
|
||||
b.Config.Entrypoint = nil
|
||||
case attributes["json"]:
|
||||
// ENTRYPOINT ["echo", "hi"]
|
||||
b.Config.Entrypoint = parsed
|
||||
case len(parsed) == 0:
|
||||
// ENTRYPOINT []
|
||||
b.Config.Entrypoint = nil
|
||||
default:
|
||||
// ENTYRPOINT echo hi
|
||||
// ENTRYPOINT echo hi
|
||||
b.Config.Entrypoint = []string{"/bin/sh", "-c", parsed[0]}
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ func (b *Builder) Run(context io.Reader) (string, error) {
|
||||
b.dockerfile = ast
|
||||
|
||||
// some initializations that would not have been supplied by the caller.
|
||||
b.Config = &runconfig.Config{Entrypoint: []string{}, Cmd: nil}
|
||||
b.Config = &runconfig.Config{}
|
||||
b.TmpContainers = map[string]struct{}{}
|
||||
|
||||
for i, n := range b.dockerfile.Children {
|
||||
|
||||
@@ -87,10 +87,11 @@ func parseLine(line string) (string, *Node, error) {
|
||||
|
||||
if sexp.Value != "" || sexp.Next != nil || sexp.Children != nil {
|
||||
node.Next = sexp
|
||||
node.Attributes = attrs
|
||||
node.Original = line
|
||||
}
|
||||
|
||||
node.Attributes = attrs
|
||||
node.Original = line
|
||||
|
||||
return "", node, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user