Skip to content

Commit 3b2fe01

Browse files
SvenDowideitArnaud Porterie
authored andcommitted
Documentation on boolean flags is wrong #10517
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
1 parent e8afc22 commit 3b2fe01

File tree

1 file changed

+13
-8
lines changed
  • docs/sources/reference/commandline

1 file changed

+13
-8
lines changed

docs/sources/reference/commandline/cli.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,24 @@ To list the help on any command just execute the command, followed by the `--hel
3232

3333
## Option types
3434

35-
Single character commandline options can be combined, so rather than
35+
Single character command line options can be combined, so rather than
3636
typing `docker run -t -i --name test busybox sh`,
3737
you can write `docker run -ti --name test busybox sh`.
3838

3939
### Boolean
4040

41-
Boolean options look like `-d=false`. The value you
42-
see is the default value which gets set if you do **not** use the
43-
boolean flag. If you do call `run -d`, that sets the
44-
opposite boolean value, so in this case, `true`, and
45-
so `docker run -d` **will** run in "detached" mode,
46-
in the background. Other boolean options are similar – specifying them
47-
will set the value to the opposite of the default value.
41+
Boolean options take the form `-d=false`. The value you see in the help text is the
42+
default value which is set if you do **not** specify that flag. If you specify
43+
a Boolean flag without a value, this will set the flag to `true`, irrespective
44+
of the default value.
45+
46+
For example, running `docker run -d` will set the value to `true`, so
47+
your container **will** run in "detached" mode, in the background.
48+
49+
Options which default to `true` (e.g., `docker build --rm=true`) can only
50+
be set to the non-default value by explicitly setting them to `false`:
51+
52+
$ docker build --rm=false .
4853

4954
### Multi
5055

0 commit comments

Comments
 (0)