зеркало из https://github.com/microsoft/docker.git
builder: avoid decoding "null" string in ADD, COPY and VOLUME step to nil slice
Signed-off-by: Soshi Katsuta <katsuta_soshi@cyberagent.co.jp>
This commit is contained in:
Родитель
5aeb48af77
Коммит
2d6952e8a5
|
@ -232,6 +232,11 @@ func parseString(rest string) (*Node, map[string]bool, error) {
|
|||
|
||||
// parseJSON converts JSON arrays to an AST.
|
||||
func parseJSON(rest string) (*Node, map[string]bool, error) {
|
||||
rest = strings.TrimLeftFunc(rest, unicode.IsSpace)
|
||||
if !strings.HasPrefix(rest, "[") {
|
||||
return nil, nil, fmt.Errorf("Error parsing \"%s\" as a JSON array", rest)
|
||||
}
|
||||
|
||||
var myJSON []interface{}
|
||||
if err := json.NewDecoder(strings.NewReader(rest)).Decode(&myJSON); err != nil {
|
||||
return nil, nil, err
|
||||
|
|
|
@ -3,6 +3,8 @@ MAINTAINER Seongyeol Lim <seongyeol37@gmail.com>
|
|||
|
||||
COPY . /go/src/github.com/docker/docker
|
||||
ADD . /
|
||||
ADD null /
|
||||
COPY nullfile /tmp
|
||||
ADD [ "vimrc", "/tmp" ]
|
||||
COPY [ "bashrc", "/tmp" ]
|
||||
COPY [ "test file", "/tmp" ]
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
(maintainer "Seongyeol Lim <seongyeol37@gmail.com>")
|
||||
(copy "." "/go/src/github.com/docker/docker")
|
||||
(add "." "/")
|
||||
(add "null" "/")
|
||||
(copy "nullfile" "/tmp")
|
||||
(add "vimrc" "/tmp")
|
||||
(copy "bashrc" "/tmp")
|
||||
(copy "test file" "/tmp")
|
||||
|
|
Загрузка…
Ссылка в новой задаче