Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 17d6c6c

Browse files
author
John Howard
committed
Builder counts from 1
Signed-off-by: John Howard <[email protected]>
1 parent 7869885 commit 17d6c6c

5 files changed

Lines changed: 30 additions & 13 deletions

File tree

builder/evaluator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ func (b *builder) dispatch(stepN int, ast *parser.Node) error {
293293
original := ast.Original
294294
flags := ast.Flags
295295
strs := []string{}
296-
msg := fmt.Sprintf("Step %d : %s", stepN, strings.ToUpper(cmd))
296+
msg := fmt.Sprintf("Step %d : %s", stepN+1, strings.ToUpper(cmd))
297297

298298
if len(ast.Flags) > 0 {
299299
msg += " " + strings.Join(ast.Flags, " ")

docs/reference/commandline/build.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ There should be informational output of the reason for failure output to
110110
$ docker build -t fail .
111111
Sending build context to Docker daemon 2.048 kB
112112
Sending build context to Docker daemon
113-
Step 0 : FROM busybox
113+
Step 1 : FROM busybox
114114
---> 4986bf8c1536
115-
Step 1 : RUN exit 13
115+
Step 2 : RUN exit 13
116116
---> Running in e26670ec7a0a
117117
INFO[0000] The command [/bin/sh -c exit 13] returned a non-zero code: 13
118118
$ echo $?
@@ -167,19 +167,19 @@ you must use `--rm=false`. This does not affect the build cache.
167167
$ docker build .
168168
Uploading context 18.829 MB
169169
Uploading context
170-
Step 0 : FROM busybox
170+
Step 1 : FROM busybox
171171
---> 769b9341d937
172-
Step 1 : CMD echo Hello world
172+
Step 2 : CMD echo Hello world
173173
---> Using cache
174174
---> 99cc1ad10469
175175
Successfully built 99cc1ad10469
176176
$ echo ".git" > .dockerignore
177177
$ docker build .
178178
Uploading context 6.76 MB
179179
Uploading context
180-
Step 0 : FROM busybox
180+
Step 1 : FROM busybox
181181
---> 769b9341d937
182-
Step 1 : CMD echo Hello world
182+
Step 2 : CMD echo Hello world
183183
---> Using cache
184184
---> 99cc1ad10469
185185
Successfully built 99cc1ad10469

docs/security/trust/trust_sandbox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ So, you'll need an entry for both the servers in your local `/etc/hosts` file.
120120

121121
$ docker build -t notarysandbox .
122122
Sending build context to Docker daemon 2.048 kB
123-
Step 0 : FROM debian:jessie
123+
Step 1 : FROM debian:jessie
124124
...
125125
Successfully built 5683f17e9d72
126126

docs/userguide/dockerimages.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,12 @@ Now let's take our `Dockerfile` and use the `docker build` command to build an i
293293
$ docker build -t ouruser/sinatra:v2 .
294294
Sending build context to Docker daemon 2.048 kB
295295
Sending build context to Docker daemon
296-
Step 0 : FROM ubuntu:14.04
296+
Step 1 : FROM ubuntu:14.04
297297
---> e54ca5efa2e9
298-
Step 1 : MAINTAINER Kate Smith <[email protected]>
298+
Step 2 : MAINTAINER Kate Smith <[email protected]>
299299
---> Using cache
300300
---> 851baf55332b
301-
Step 2 : RUN apt-get update && apt-get install -y ruby ruby-dev
301+
Step 3 : RUN apt-get update && apt-get install -y ruby ruby-dev
302302
---> Running in 3a2558904e9b
303303
Selecting previously unselected package libasan0:amd64.
304304
(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
433433
Running hooks in /etc/ca-certificates/update.d....done.
434434
---> c55c31703134
435435
Removing intermediate container 3a2558904e9b
436-
Step 3 : RUN gem install sinatra
436+
Step 4 : RUN gem install sinatra
437437
---> Running in 6b81cb6313e5
438438
unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for README.rdoc, skipping
439439
unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for README.rdoc, skipping

integration-cli/docker_cli_build_test.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5316,7 +5316,24 @@ func (s *DockerSuite) TestBuildNoDupOutput(c *check.C) {
53165316
c.Fatalf("Build should have worked: %q", err)
53175317
}
53185318

5319-
exp := "\nStep 1 : RUN env\n"
5319+
exp := "\nStep 2 : RUN env\n"
5320+
if !strings.Contains(out, exp) {
5321+
c.Fatalf("Bad output\nGot:%s\n\nExpected to contain:%s\n", out, exp)
5322+
}
5323+
}
5324+
5325+
// GH15826
5326+
func (s *DockerSuite) TestBuildStartsFromOne(c *check.C) {
5327+
// Explicit check to ensure that build starts from step 1 rather than 0
5328+
name := "testbuildstartsfromone"
5329+
5330+
_, out, err := buildImageWithOut(name, `
5331+
FROM busybox`, false)
5332+
if err != nil {
5333+
c.Fatalf("Build should have worked: %q", err)
5334+
}
5335+
5336+
exp := "\nStep 1 : FROM busybox\n"
53205337
if !strings.Contains(out, exp) {
53215338
c.Fatalf("Bad output\nGot:%s\n\nExpected to contain:%s\n", out, exp)
53225339
}

0 commit comments

Comments
 (0)