diff --git a/builder/evaluator.go b/builder/evaluator.go index de0fbe5f67..2b0c038a01 100644 --- a/builder/evaluator.go +++ b/builder/evaluator.go @@ -293,7 +293,7 @@ func (b *builder) dispatch(stepN int, ast *parser.Node) error { original := ast.Original flags := ast.Flags strs := []string{} - msg := fmt.Sprintf("Step %d : %s", stepN, strings.ToUpper(cmd)) + msg := fmt.Sprintf("Step %d : %s", stepN+1, strings.ToUpper(cmd)) if len(ast.Flags) > 0 { msg += " " + strings.Join(ast.Flags, " ") diff --git a/docs/reference/commandline/build.md b/docs/reference/commandline/build.md index 037003d9be..633d1132de 100644 --- a/docs/reference/commandline/build.md +++ b/docs/reference/commandline/build.md @@ -110,9 +110,9 @@ There should be informational output of the reason for failure output to $ docker build -t fail . Sending build context to Docker daemon 2.048 kB Sending build context to Docker daemon - Step 0 : FROM busybox + Step 1 : FROM busybox ---> 4986bf8c1536 - Step 1 : RUN exit 13 + Step 2 : RUN exit 13 ---> Running in e26670ec7a0a INFO[0000] The command [/bin/sh -c exit 13] returned a non-zero code: 13 $ echo $? @@ -167,9 +167,9 @@ you must use `--rm=false`. This does not affect the build cache. $ docker build . Uploading context 18.829 MB Uploading context - Step 0 : FROM busybox + Step 1 : FROM busybox ---> 769b9341d937 - Step 1 : CMD echo Hello world + Step 2 : CMD echo Hello world ---> Using cache ---> 99cc1ad10469 Successfully built 99cc1ad10469 @@ -177,9 +177,9 @@ you must use `--rm=false`. This does not affect the build cache. $ docker build . Uploading context 6.76 MB Uploading context - Step 0 : FROM busybox + Step 1 : FROM busybox ---> 769b9341d937 - Step 1 : CMD echo Hello world + Step 2 : CMD echo Hello world ---> Using cache ---> 99cc1ad10469 Successfully built 99cc1ad10469 diff --git a/docs/security/trust/trust_sandbox.md b/docs/security/trust/trust_sandbox.md index 5f64889cf2..dfaa05216d 100644 --- a/docs/security/trust/trust_sandbox.md +++ b/docs/security/trust/trust_sandbox.md @@ -120,7 +120,7 @@ So, you'll need an entry for both the servers in your local `/etc/hosts` file. $ docker build -t notarysandbox . Sending build context to Docker daemon 2.048 kB - Step 0 : FROM debian:jessie + Step 1 : FROM debian:jessie ... Successfully built 5683f17e9d72 diff --git a/docs/userguide/dockerimages.md b/docs/userguide/dockerimages.md index 795fff81a3..54d16ffd08 100644 --- a/docs/userguide/dockerimages.md +++ b/docs/userguide/dockerimages.md @@ -293,12 +293,12 @@ Now let's take our `Dockerfile` and use the `docker build` command to build an i $ docker build -t ouruser/sinatra:v2 . Sending build context to Docker daemon 2.048 kB Sending build context to Docker daemon - Step 0 : FROM ubuntu:14.04 + Step 1 : FROM ubuntu:14.04 ---> e54ca5efa2e9 - Step 1 : MAINTAINER Kate Smith + Step 2 : MAINTAINER Kate Smith ---> Using cache ---> 851baf55332b - Step 2 : RUN apt-get update && apt-get install -y ruby ruby-dev + Step 3 : RUN apt-get update && apt-get install -y ruby ruby-dev ---> Running in 3a2558904e9b Selecting previously unselected package libasan0:amd64. (Reading database ... 11518 files and directories currently installed.) @@ -433,7 +433,7 @@ Now let's take our `Dockerfile` and use the `docker build` command to build an i Running hooks in /etc/ca-certificates/update.d....done. ---> c55c31703134 Removing intermediate container 3a2558904e9b - Step 3 : RUN gem install sinatra + Step 4 : RUN gem install sinatra ---> Running in 6b81cb6313e5 unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for README.rdoc, skipping unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for README.rdoc, skipping diff --git a/integration-cli/docker_cli_build_test.go b/integration-cli/docker_cli_build_test.go index bf7de304c5..e2294f969b 100644 --- a/integration-cli/docker_cli_build_test.go +++ b/integration-cli/docker_cli_build_test.go @@ -5316,7 +5316,24 @@ func (s *DockerSuite) TestBuildNoDupOutput(c *check.C) { c.Fatalf("Build should have worked: %q", err) } - exp := "\nStep 1 : RUN env\n" + exp := "\nStep 2 : RUN env\n" + if !strings.Contains(out, exp) { + c.Fatalf("Bad output\nGot:%s\n\nExpected to contain:%s\n", out, exp) + } +} + +// GH15826 +func (s *DockerSuite) TestBuildStartsFromOne(c *check.C) { + // Explicit check to ensure that build starts from step 1 rather than 0 + name := "testbuildstartsfromone" + + _, out, err := buildImageWithOut(name, ` + FROM busybox`, false) + if err != nil { + c.Fatalf("Build should have worked: %q", err) + } + + exp := "\nStep 1 : FROM busybox\n" if !strings.Contains(out, exp) { c.Fatalf("Bad output\nGot:%s\n\nExpected to contain:%s\n", out, exp) }