Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added latest bits of docker build #9

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 6 additions & 24 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

docker "github.com/fsouza/go-dockerclient"

"github.com/docker/docker/builder/command"
"github.com/docker/docker/builder/parser"
"github.com/docker/docker/builder/dockerfile/command"
"github.com/docker/docker/builder/dockerfile/parser"
)

// Copy defines a copy operation required on the container.
Expand Down Expand Up @@ -222,7 +222,9 @@ func (b *Builder) FromImage(image *docker.Image, node *parser.Node) error {
if image.Config == nil || len(image.Config.OnBuild) == 0 {
return nil
}
extra, err := parser.Parse(bytes.NewBufferString(strings.Join(image.Config.OnBuild, "\n")))
d := parser.Directive{LookingForDirectives: true}
parser.SetEscapeToken(parser.DefaultEscapeToken, &d)
extra, err := parser.Parse(bytes.NewBufferString(strings.Join(image.Config.OnBuild, "\n")), &d)
if err != nil {
return err
}
Expand Down
15 changes: 10 additions & 5 deletions builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ import (
"testing"

"fmt"
"github.com/docker/docker/builder/parser"
docker "github.com/fsouza/go-dockerclient"
"reflect"

"github.com/docker/docker/builder/dockerfile/parser"
docker "github.com/fsouza/go-dockerclient"
)

func TestRun(t *testing.T) {
f, err := os.Open("dockerclient/testdata/Dockerfile.add")
if err != nil {
t.Fatal(err)
}
node, err := parser.Parse(f)
d := parser.Directive{LookingForDirectives: true}
parser.SetEscapeToken(parser.DefaultEscapeToken, &d)
node, err := parser.Parse(f, &d)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -136,7 +139,7 @@ func TestBuilder(t *testing.T) {
From: "busybox",
Unrecognized: []Step{
Step{Command: "health", Message: "HEALTH ", Original: "HEALTH NONE", Args: []string{""}, Flags: []string{}, Env: []string{}},
Step{Command: "shell", Message: "SHELL ", Original: "SHELL [\"/bin/sh\", \"-c\"]", Args: []string{""}, Flags: []string{}, Env: []string{}},
Step{Command: "shell", Message: "SHELL /bin/sh -c", Original: "SHELL [\"/bin/sh\", \"-c\"]", Args: []string{"/bin/sh", "-c"}, Flags: []string{}, Env: []string{}, Attrs: map[string]bool{"json": true}},
Step{Command: "unrecognized", Message: "UNRECOGNIZED ", Original: "UNRECOGNIZED", Args: []string{""}, Env: []string{}},
},
Config: docker.Config{
Expand Down Expand Up @@ -178,7 +181,9 @@ func TestBuilder(t *testing.T) {
t.Errorf("%d: %v", i, err)
continue
}
node, err := parser.Parse(bytes.NewBuffer(data))
d := parser.Directive{LookingForDirectives: true}
parser.SetEscapeToken(parser.DefaultEscapeToken, &d)
node, err := parser.Parse(bytes.NewBuffer(data), &d)
if err != nil {
t.Errorf("%d: %v", i, err)
continue
Expand Down
6 changes: 4 additions & 2 deletions dockerclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"strconv"
"strings"

"github.com/docker/docker/builder/parser"
"github.com/docker/docker/builder/dockerfile/parser"
dockertypes "github.com/docker/engine-api/types"
docker "github.com/fsouza/go-dockerclient"
"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive"
Expand Down Expand Up @@ -105,7 +105,9 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {

// TODO: check the Docker daemon version (1.20 is required for Upload)

node, err := parser.Parse(r)
d := parser.Directive{LookingForDirectives: true}
parser.SetEscapeToken(parser.DefaultEscapeToken, &d)
node, err := parser.Parse(r, &d)
if err != nil {
return err
}
Expand Down
8 changes: 5 additions & 3 deletions dockerclient/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"testing"
"time"

"github.com/docker/docker/builder/command"
"github.com/docker/docker/builder/parser"
"github.com/docker/docker/builder/dockerfile/command"
"github.com/docker/docker/builder/dockerfile/parser"
docker "github.com/fsouza/go-dockerclient"
"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive"
"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/fileutils"
Expand Down Expand Up @@ -197,7 +197,9 @@ func conformanceTester(t *testing.T, c *docker.Client, test conformanceTest, i i
t.Errorf("%d: unable to read Dockerfile %q: %v", i, input, err)
return
}
node, err := parser.Parse(bytes.NewBuffer(data))
d := parser.Directive{LookingForDirectives: true}
parser.SetEscapeToken(parser.DefaultEscapeToken, &d)
node, err := parser.Parse(bytes.NewBuffer(data), &d)
if err != nil {
t.Errorf("%d: can't parse Dockerfile %q: %v", i, input, err)
return
Expand Down
4 changes: 2 additions & 2 deletions evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"strings"

"github.com/docker/docker/builder/command"
"github.com/docker/docker/builder/parser"
"github.com/docker/docker/builder/dockerfile/command"
"github.com/docker/docker/builder/dockerfile/parser"
)

// Environment variable interpolation will happen on these statements only.
Expand Down
139 changes: 0 additions & 139 deletions vendor/github.com/docker/distribution/digest/digest.go

This file was deleted.

Loading