From d15f8feaa86453147161db6e1b2ec2538e11ecfd Mon Sep 17 00:00:00 2001 From: Sven Dowideit Date: Mon, 16 Feb 2015 10:02:56 +1000 Subject: [PATCH] Add some information about the docker build return code Signed-off-by: Sven Dowideit --- docs/sources/reference/commandline/cli.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/sources/reference/commandline/cli.md b/docs/sources/reference/commandline/cli.md index 1d784d72e1..a0136fe02c 100644 --- a/docs/sources/reference/commandline/cli.md +++ b/docs/sources/reference/commandline/cli.md @@ -525,6 +525,29 @@ on your local host, and then this is sent to the Docker daemon as the context. This way, your local user credentials and VPN's etc can be used to access private repositories. +### Return code + +On a successful build, a return code of success `0` will be returned. +When the build fails, a non-zero failure code will be returned. + +There should be informational output of the reason for failure output +to `STDERR`: + +``` +$ docker build -t fail . +Sending build context to Docker daemon 2.048 kB +Sending build context to Docker daemon +Step 0 : FROM busybox + ---> 4986bf8c1536 +Step 1 : RUN exit 13 + ---> Running in e26670ec7a0a +INFO[0000] The command [/bin/sh -c exit 13] returned a non-zero code: 13 +$ echo $? +1 +``` + +### .dockerignore file + If a file named `.dockerignore` exists in the root of `PATH` then it is interpreted as a newline-separated list of exclusion patterns. Exclusion patterns match files or directories relative to `PATH` that