Merge pull request #7814 from erikh/fix_parser_env

Fix panic when `ENV ARG=ARG` is used.
Upstream-commit: 09d36709076ac56387a12a7465b6a236e1253ff5
Component: engine
This commit is contained in:
Victor Vieux
2014-09-01 11:03:21 -07:00
2 changed files with 9 additions and 0 deletions
@@ -9,6 +9,7 @@ package parser
import (
"encoding/json"
"errors"
"fmt"
"strconv"
"strings"
)
@@ -43,6 +44,11 @@ func parseEnv(rest string) (*Node, map[string]bool, error) {
node := &Node{}
rootnode := node
strs := TOKEN_WHITESPACE.Split(rest, 2)
if len(strs) < 2 {
return nil, nil, fmt.Errorf("ENV must have two arguments")
}
node.Value = strs[0]
node.Next = &Node{}
node.Next.Value = strs[1]
@@ -0,0 +1,3 @@
FROM busybox
ENV PATH=PATH