File tree Expand file tree Collapse file tree
docs/sources/reference/commandline Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -537,6 +537,29 @@ If you use STDIN or specify a `URL`, the system places the contents into a
537537file called ` Dockerfile ` , and any ` -f ` , ` --file ` option is ignored. In this
538538scenario, there is no context.
539539
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+
540563If a file named ` .dockerignore ` exists in the root of ` PATH ` then it
541564is interpreted as a newline-separated list of exclusion patterns.
542565Exclusion patterns match files or directories relative to ` PATH ` that
You can’t perform that action at this time.
0 commit comments