Browse code

Rewrote the ENTRYPOINT section in builder

Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)

James Turnbull authored on 2014/07/12 08:50:25
Showing 1 changed files
... ...
@@ -374,41 +374,47 @@ The copy obeys the following rules:
374 374
 ENTRYPOINT has two forms:
375 375
 
376 376
 - `ENTRYPOINT ["executable", "param1", "param2"]`
377
-  (like an *exec*, preferred form)
377
+  (like an *exec*, the preferred form)
378 378
 - `ENTRYPOINT command param1 param2`
379 379
   (as a *shell*)
380 380
 
381
-There can only be one `ENTRYPOINT` in a Dockerfile. If you have more than one
382
-`ENTRYPOINT`, then only the last one in the Dockerfile will have an effect.
381
+There can only be one `ENTRYPOINT` in a `Dockerfile`. If you have more
382
+than one `ENTRYPOINT`, then only the last one in the `Dockerfile` will
383
+have an effect.
383 384
 
384
-An `ENTRYPOINT` helps you to configure a container that you can run as an
385
-executable. That is, when you specify an `ENTRYPOINT`, then the whole container
386
-runs as if it was just that executable.
385
+An `ENTRYPOINT` helps you to configure a container that you can run as
386
+an executable. That is, when you specify an `ENTRYPOINT`, then the whole
387
+container runs as if it was just that executable.
387 388
 
388
-The `ENTRYPOINT` instruction adds an entry command that will **not** be
389
-overwritten when arguments are passed to `docker run`, unlike the behavior
390
-of `CMD`. This allows arguments to be passed to the entrypoint. i.e. 
391
-`docker run <image> -d` will pass the "-d" argument to the ENTRYPOINT.
389
+Unlike the behavior of the `CMD` instruction, The `ENTRYPOINT`
390
+instruction adds an entry command that will **not** be overwritten when
391
+arguments are passed to `docker run`. This allows arguments to be passed
392
+to the entry point, i.e.  `docker run <image> -d` will pass the `-d`
393
+argument to the entry point.
392 394
 
393
-You can specify parameters either in the ENTRYPOINT JSON array (as in
394
-"like an exec" above), or by using a CMD statement. Parameters in the
395
-ENTRYPOINT will not be overridden by the `docker run`
396
-arguments, but parameters specified via CMD will be overridden
397
-by `docker run` arguments.
395
+You can specify parameters either in the `ENTRYPOINT` JSON array (as in
396
+"like an exec" above), or by using a `CMD` instruction. Parameters in
397
+the `ENTRYPOINT` instruction will not be overridden by the `docker run`
398
+arguments, but parameters specified via a `CMD` instruction will be
399
+overridden by `docker run` arguments.
398 400
 
399
-Like a `CMD`, you can specify a plain string for the `ENTRYPOINT` and it will
400
-execute in `/bin/sh -c`:
401
+Like a `CMD`, you can specify a plain string for the `ENTRYPOINT` and it
402
+will execute in `/bin/sh -c`:
401 403
 
402 404
     FROM ubuntu
403
-    ENTRYPOINT wc -l -
405
+    ENTRYPOINT ls -l
404 406
 
405
-For example, that Dockerfile's image will *always* take STDIN as input
406
-("-") and print the number of lines ("-l"). If you wanted to make this
407
-optional but default, you could use a CMD:
407
+For example, that `Dockerfile`'s image will *always* take a directory as
408
+an input and return a directory listing. If you wanted to make this
409
+optional but default, you could use a `CMD` instruction:
408 410
 
409 411
     FROM ubuntu
410
-    CMD ["-l", "-"]
411
-    ENTRYPOINT ["/usr/bin/wc"]
412
+    CMD ["-l"]
413
+    ENTRYPOINT ["/usr/bin/ls"]
414
+
415
+> **Note**:
416
+> It is preferable to use the JSON array format for specifying
417
+> `ENTRYPOINT` instructions.
412 418
 
413 419
 ## VOLUME
414 420