Add some information about the docker build return code
| ... | ... |
@@ -537,6 +537,29 @@ If you use STDIN or specify a `URL`, the system places the contents into a |
| 537 | 537 |
file called `Dockerfile`, and any `-f`, `--file` option is ignored. In this |
| 538 | 538 |
scenario, there is no context. |
| 539 | 539 |
|
| 540 |
+### Return code |
|
| 541 |
+ |
|
| 542 |
+On a successful build, a return code of success `0` will be returned. |
|
| 543 |
+When the build fails, a non-zero failure code will be returned. |
|
| 544 |
+ |
|
| 545 |
+There should be informational output of the reason for failure output |
|
| 546 |
+to `STDERR`: |
|
| 547 |
+ |
|
| 548 |
+``` |
|
| 549 |
+$ docker build -t fail . |
|
| 550 |
+Sending build context to Docker daemon 2.048 kB |
|
| 551 |
+Sending build context to Docker daemon |
|
| 552 |
+Step 0 : FROM busybox |
|
| 553 |
+ ---> 4986bf8c1536 |
|
| 554 |
+Step 1 : RUN exit 13 |
|
| 555 |
+ ---> Running in e26670ec7a0a |
|
| 556 |
+INFO[0000] The command [/bin/sh -c exit 13] returned a non-zero code: 13 |
|
| 557 |
+$ echo $? |
|
| 558 |
+1 |
|
| 559 |
+``` |
|
| 560 |
+ |
|
| 561 |
+### .dockerignore file |
|
| 562 |
+ |
|
| 540 | 563 |
If a file named `.dockerignore` exists in the root of `PATH` then it |
| 541 | 564 |
is interpreted as a newline-separated list of exclusion patterns. |
| 542 | 565 |
Exclusion patterns match files or directories relative to `PATH` that |