Commit Graph

111 Commits

Author SHA1 Message Date
409ca07fc0 Document arg before from
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 83a4afe2645d2e39cf6b10a86e9e681a7ff06eb2
Component: engine
2017-05-12 18:45:08 -04:00
0e1fc8025c Add Dockerfile reference docs for using ARG in FROM
Also fixed some examples of using `docker build` to clarify that the
positional argument is a directory, not a file.

Also fixed some terminology. Dockerfiles contain instructions, not directives or
commands.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 3437715e20b3a1b16ea93a47802794b58b007863
Component: engine
2017-04-11 11:34:43 -04:00
b91fdec82e Merge pull request #32362 from tonistiigi/multi-stage-build-docs
Add docs for multi-stage builds
Upstream-commit: 2ba9783d1a50a519a42e69dbfa7b3b0755938a25
Component: engine
2017-04-10 14:26:08 +02:00
88cdacca6c Add docs for named build stages
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 877ac98e44f2b1d9af6319ca07d232a3cd929d39
Component: engine
2017-04-09 20:40:50 -07:00
e25f6c5a1b Added start period option to health check.
Signed-off-by: Elias Faxö <elias.faxo@gmail.com>
Upstream-commit: e401f63735d8ebcff387c571d1f61ce52bdea86e
Component: engine
2017-04-06 12:35:34 +02:00
df8db8303f remove the duplicate line from doc and rebase with master for 'example of ADD and COPY with special characters file name'
Signed-off-by: Foysal Iqbal <foysal.iqbal.fb@gmail.com>
Upstream-commit: dacf8fa27c576512cecea4a15b9adb93808c9743
Component: engine
2017-03-22 15:08:17 -04:00
3866c616c0 Merge pull request #31980 from JohnMaguire/doc-update
Add note regarding Windows VOLUME limitations
Upstream-commit: c33c457852bd6901ecc1f81449b59984a555a963
Component: engine
2017-03-22 12:01:36 -07:00
c8fe0a8414 Add note regarding Windows VOLUME limitations
Signed-off-by: John Maguire <jmaguire@duosecurity.com>
Upstream-commit: 020ec88542e88bb561c30a1ec984d0a17c74b7f9
Component: engine
2017-03-22 14:57:42 -04:00
cc2d5e2aaf Ignore built-in allowed build-args in image history
Removes the build-args from the image history if they are in the
BuiltinAllowedBuildArgs map unless they are explicitly defined in an ARG
instruction.

Signed-off-by: Dave Tucker <dt@docker.com>
Upstream-commit: 89a2a885c82bade2774f4b669b4e09ede8f840c3
Component: engine
2017-03-21 16:36:48 +00:00
6b69c9da09 Fix directive example to match description
The description claims the directive is appearing after a comment but
the sample Dockerfile has the directive appear after an instruction.
Changed the ordering of the lines to match the example's description.

Signed-off-by: Remy Suen <remy.suen@gmail.com>
Upstream-commit: f00fa639881a9ef2ab2959f11fa30554396a3dac
Component: engine
2017-03-10 07:11:30 +09:00
ec2663feb9 Convert script shebangs from "#!/bin/bash" to "#!/usr/bin/env bash"
This is especially important for distributions like NixOS where `/bin/bash` doesn't exist, or for MacOS users who've installed a newer version of Bash than the one that comes with their OS.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 52379fa76dee07ca038624d639d9e14f4fb719ff
Component: engine
2017-02-13 11:01:54 -08:00
bb87b715d8 Windows: Unify workdir handling
Signed-off-by: John Howard <jhoward@microsoft.com>

Working directory processing was handled differently for Hyper-V and Windows-Server containers, as annotated in the builder documentation (updated in this PR). For Hyper-V containers, the working directory set by WORKDIR was not created. This PR makes Hyper-V containers work the same as Windows Server containers (and the same as Linux).

Example (only applies to Hyper-V containers, so not reproducible under CI environment)
Dockerfile:
FROM microsoft/nanoserver
WORKDIR c:\installer
ENV GOROOT=c:\installer
ADD go.exe .
RUN go --help
Running on Windows Server 2016, using docker master without this change, but with daemon set to --exec-opt isolation=hyperv as it would be for Client operating systems.
PS E:\go\src\github.com\docker\docker> dockerd -g c:\control --exec-opt isolation=hyperv
time="2017-02-01T15:48:09.657286100-08:00" level=info msg="Windows default isolation mode: hyperv"
time="2017-02-01T15:48:09.662720900-08:00" level=info msg="[graphdriver] using prior storage driver: windowsfilter"
time="2017-02-01T15:48:10.011588000-08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
time="2017-02-01T15:48:10.016655800-08:00" level=info msg="Loading containers: start."
time="2017-02-01T15:48:10.460820000-08:00" level=info msg="Loading containers: done."
time="2017-02-01T15:48:10.509859600-08:00" level=info msg="Daemon has completed initialization"
time="2017-02-01T15:48:10.509859600-08:00" level=info msg="Docker daemon" commit=3c64061 graphdriver=windowsfilter version=1.14.0-dev
First with no explicit isolation:
PS E:\docker\build\unifyworkdir> docker build --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> 7e0f41d08204
Removing intermediate container 236c7802042a
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in 8ea5237183c1
 ---> 394b70435261
Removing intermediate container 8ea5237183c1
Step 4/5 : ADD go.exe .
 ---> e47401a1745c
Removing intermediate container 88dcc28e74b1
Step 5/5 : RUN go --help
 ---> Running in efe90e1b6b8b
container efe90e1b6b8b76586abc5c1dc0e2797b75adc26517c48733d90651e767c8463b encountered an error during CreateProcess: failure in a Windows system call: The directory name is invalid. (0x10b) extra info: {"ApplicationName":"","CommandLine":"cmd /S /C go --help","User":"","WorkingDirectory":"C:\\installer","Environment":{"GOROOT":"c:\\installer"},"EmulateConsole":false,"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0]}
PS E:\docker\build\unifyworkdir>
Then forcing process isolation:
PS E:\docker\build\unifyworkdir> docker build --isolation=process --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> 350c955980c8
Removing intermediate container 8339c1e9250c
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in bde511c5e3e0
 ---> b8820063b5b6
Removing intermediate container bde511c5e3e0
Step 4/5 : ADD go.exe .
 ---> e4ac32f8902b
Removing intermediate container d586e8492eda
Step 5/5 : RUN go --help
 ---> Running in 9e1aa235af5f
Cannot mkdir: C:\installer is not a directory
PS E:\docker\build\unifyworkdir>
Now compare the same results after this PR. Again, first with no explicit isolation (defaulting to Hyper-V containers as that's what the daemon it set to) - note it now succeeds 😄
PS E:\docker\build\unifyworkdir> docker build --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> 4f319f301c69
Removing intermediate container 61b9c0b1ff6f
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in c464a1d612d8
 ---> 96a26ab9a7b5
Removing intermediate container c464a1d612d8
Step 4/5 : ADD go.exe .
 ---> 0290d61faf57
Removing intermediate container dc5a085fffe3
Step 5/5 : RUN go --help
 ---> Running in 60bd56042ff8
Go is a tool for managing Go source code.

Usage:

        go command [arguments]

The commands are:

        build       compile packages and dependencies
        clean       remove object files
        doc         show documentation for package or symbol
        env         print Go environment information
        fix         run go tool fix on packages
        fmt         run gofmt on package sources
        generate    generate Go files by processing source
        get         download and install packages and dependencies
        install     compile and install packages and dependencies
        list        list packages
        run         compile and run Go program
        test        test packages
        tool        run specified go tool
        version     print Go version
        vet         run go tool vet on packages

Use "go help [command]" for more information about a command.

Additional help topics:

        c           calling between Go and C
        buildmode   description of build modes
        filetype    file types
        gopath      GOPATH environment variable
        environment environment variables
        importpath  import path syntax
        packages    description of package lists
        testflag    description of testing flags
        testfunc    description of testing functions

Use "go help [topic]" for more information about that topic.

The command 'cmd /S /C go --help' returned a non-zero code: 2
And the same with forcing process isolation. Also works 😄
PS E:\docker\build\unifyworkdir> docker build --isolation=process --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> f423b9cc3e78
Removing intermediate container 41330c88893d
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in 0b99a2d7bf19
 ---> e051144bf8ec
Removing intermediate container 0b99a2d7bf19
Step 4/5 : ADD go.exe .
 ---> 7072e32b7c37
Removing intermediate container a7a97aa37fd1
Step 5/5 : RUN go --help
 ---> Running in 7097438a54e5
Go is a tool for managing Go source code.

Usage:

        go command [arguments]

The commands are:

        build       compile packages and dependencies
        clean       remove object files
        doc         show documentation for package or symbol
        env         print Go environment information
        fix         run go tool fix on packages
        fmt         run gofmt on package sources
        generate    generate Go files by processing source
        get         download and install packages and dependencies
        install     compile and install packages and dependencies
        list        list packages
        run         compile and run Go program
        test        test packages
        tool        run specified go tool
        version     print Go version
        vet         run go tool vet on packages

Use "go help [command]" for more information about a command.

Additional help topics:

        c           calling between Go and C
        buildmode   description of build modes
        filetype    file types
        gopath      GOPATH environment variable
        environment environment variables
        importpath  import path syntax
        packages    description of package lists
        testflag    description of testing flags
        testfunc    description of testing functions

Use "go help [topic]" for more information about that topic.

The command 'cmd /S /C go --help' returned a non-zero code: 2
PS E:\docker\build\unifyworkdir>
Upstream-commit: f42033ba9484ab31611bb1e4a0416beb3aa956da
Component: engine
2017-02-02 11:25:07 -08:00
8c4159ea41 Fix for https://github.com/docker/docker.github.io/issues/1413
Signed-off-by: John Mulhausen <john@docker.com>
Upstream-commit: 3c3456885d7309137146950302e7c0c34752143b
Component: engine
2017-01-31 18:59:21 -08:00
0bceafbfa1 Fix syntax in example
Signed-off-by: Jeroen Franse <jeroenfranse@gmail.com>
Upstream-commit: ada374f316579e55d5a350f4e9a1e5674af95106
Component: engine
2017-01-31 23:51:06 +01:00
369f49aace Merge pull request #30351 from friism/patch-9
remove indent from .dockerignore example
Upstream-commit: 4f926b67f4ee2c1494332d7f1021e3fc45ef045a
Component: engine
2017-01-23 11:30:23 +01:00
cbe273ba85 remove indent from .dockerignore example
Signed-off-by: Michael Friis <friism@gmail.com>
Upstream-commit: 0f5a98122f92d3fef520773ea619523129794fd7
Component: engine
2017-01-22 10:46:04 -08:00
05863e58e5 Merge pull request #30329 from johndmulhausen/patch-2
Fixing formatting errors in Run refdoc

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 74ed368e7a3a00b3fb24778763656d873293068d
Component: engine
2017-01-20 14:47:18 -08:00
420207ba8c correct some words
Signed-off-by: liwenqi <vikilwq@zju.edu.cn>

Update ISSUE-TRIAGE.md

Signed-off-by: vicky <395658237@qq.com>
Upstream-commit: b506f8ecdd5ca8adb5d8ad77f085283ee5f584d6
Component: engine
2016-12-20 17:43:26 +08:00
8c052677e4 Update docs for the output of docker build (Step 1/...)
PR 24978 adds hint of of progress to the output of `docker build`
for 1.13, in the format of
```
Step 1/5 ...
...
Step 2/5 ...
...
```

Though some of the docs hasn't been updated.

This fix did a grep in docs and updated the related places.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 7d529492cc8b902bbf2e1f293546e3b19134db1b
Component: engine
2016-11-05 19:05:19 -07:00
062414bb0e fix frontmatter keywords value type (string, instead of []string) in /docs/reference
Signed-off-by: Gaetan de Villele <gdevillele@gmail.com>
Upstream-commit: 248c699ec88bb249ce9fd03001d13f29ac0b4b99
Component: engine
2016-11-03 15:48:30 -07:00
bedb3b19ee Convert Unused ARG error to warning
Signed-off-by: Addam Hardy <addam.hardy@gmail.com>
Upstream-commit: f150f42009dddb4f9b8d4ceef8763af701b0d0f9
Component: engine
2016-10-31 21:42:50 -05:00
34bac6f06e Fix bunch of typos
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: e6866492c4492db3bb9546afa2fbaed20f4c1883
Component: engine
2016-10-29 15:03:26 +08:00
6aae774656 Merge pull request #27863 from Microsoft/jjh/clarifyworkdir
Windows: Clarify WORKDIR in docs
Upstream-commit: beccf0f8986d1182fc2b3e192508d1309d5fc5c1
Component: engine
2016-10-28 14:07:03 -07:00
41f493236b Merge pull request #27819 from lixiaobing10051267/masterDirInvalid
fill all the rest invalid address because no related directory
Upstream-commit: 010ee5a8e84b3bb5f5a79690e77fd9b135643641
Component: engine
2016-10-28 13:05:18 -07:00
b0519ec516 Merge pull request #27815 from lixiaobing10051267/masterDocsDel
fill the complete address because of no userguide directory
Upstream-commit: cfe7cb0292eb9654fba13d380ead30f2525d09df
Component: engine
2016-10-28 13:04:04 -07:00
7e8bfe389f Update examples in builder.md
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 744cf2c9718a43aad21c6dee53a07856ef06fc79
Component: engine
2016-10-28 11:36:11 -07:00
d16a71e0f2 Windows: Clarify WORKDIR in docs
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: e87c6dd3e48135637d12067dd158252b5c27349b
Component: engine
2016-10-28 10:28:38 -07:00
17e336a83a fill all the rest invalid address because no related directory
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: 7d1eb5ea1bcf68391576f92a0660ac785a498fd4
Component: engine
2016-10-28 11:12:54 +08:00
810cfad17d fill the complete address because of no userguide directory
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: 97c00f9754271bbc03c6309793482e11920e4f3e
Component: engine
2016-10-28 10:57:37 +08:00
b2f3f16f09 Sync docker/docker refs with files mistakenly edited in docker.github.io repo
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 3b36f02c03ec050aa46f9a01cd2d6c60ffd93652
Component: engine
2016-10-20 10:51:30 -07:00
96340571d8 Fix typos in docs/reference/builder.md.
Signed-off-by: Ding Fei <dingfei@stars.org.cn>
Upstream-commit: 9ccb1f159e964384df32c083058197340941fafa
Component: engine
2016-10-18 18:05:37 +08:00
9fe833df60 Convert Markdown frontmatter to YAML
Some frontmatter such as the weights, menu stuff, etc is no longer used
'draft=true' becomes 'published: false'

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: b30609446d212624e3d4ce814c70130b75c552a0
Component: engine
2016-10-14 15:44:55 -07:00
cc3c0d322a Implement build cache based on history array
Based on work by KJ Tsanaktsidis

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: KJ Tsanaktsidis <kjtsanaktsidis@gmail.com>
Upstream-commit: 690882c2e79c3f3742c709cf158584e61594ba00
Component: engine
2016-09-23 11:30:06 -07:00
a0b2adc110 Merge pull request #26516 from yongtang/26453-build-bad-syntax
Check bad syntax on dockerfile before building.
Upstream-commit: 72f556a9ff1043a4188e8eeef892d8a0ba4fe34f
Component: engine
2016-09-23 12:24:20 +02:00
9e4c8c252a Update documentation and change log to include the preliminary validation of dockerfile.
This commit updates documentation and change log to include
the preliminary validation of the dockerfile before instructions
in dockerfile is run one-by-one.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e33dea5b40a52c5dcda682a1a292584ae6bff00d
Component: engine
2016-09-22 14:33:37 -07:00
2a2af20475 Merge pull request #25774 from ddgenome/cmd-entrypoint-table
Update ENTRYPOINT/CMD table to agree with docs
Upstream-commit: 37869b237ccd6c8f48132d9372111acdf9533d1b
Component: engine
2016-09-15 09:35:13 +10:00
afc1ccd008 Merge pull request #25466 from justincormack/deprecate-maintainer
Begin process of deprecating MAINTAINER
Upstream-commit: 4d187df277153bf704868d9a67b1e4fa29abf873
Component: engine
2016-09-13 12:07:04 +02:00
70a2fe1d7b Fix documentation for Step 0 to Step 1 in docker build
The indexing of steps in the output of `docker build` starts with `Step 1`.
However, there are several places in the docs that start with `Step 0`.

This fix addresses the issue and changes `Step 0` to `Step 1` (and subsequent steps).

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 256dbe4b752ba1fde88e6fad76e3a6b08e4a8816
Component: engine
2016-09-11 10:52:40 -07:00
2aa55a3d95 Fix typo in builder.md
Signed-off-by: Kris-Mikael Krister <krismikael@protonmail.com>
Upstream-commit: afcfa77dd80defa996d7d0e073d809ac03493f05
Component: engine
2016-08-30 09:34:10 +02:00
8610d3a32b Begin process of deprecating MAINTAINER
This may take some time, but start by pointing people at
LABEL instead.

MAINTAINER predates general LABEL and has basically no tooling,
only allows a single item to be added, and is has been
unofficially deprecated for some time, with many images not
including it, but we have never specifically said that it
should be replaced by LABEL as a better more generic metadata
solution.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: efb9e38ebab4b60a73e3295e3c468813182fd3ea
Component: engine
2016-08-25 18:43:27 +01:00
536db7fdc5 Merge pull request #25775 from ddgenome/entrypoint-env
Remove erroneous ENTRYPOINT note
Upstream-commit: c1bdda0be8616f987245cb61a4aedc09c8b5c806
Component: engine
2016-08-22 09:13:54 +02:00
84a03f36d0 docs: fix typo in url fragment
I noticed the broken hyperlink in this page:
https://docs.docker.com/engine/reference/builder/
The link should point to `#parser-directives`.

Signed-off-by: Mihai Borobocea <MihaiBorob@gmail.com>
Upstream-commit: 441ecc459f0d08a930ee2d6f4502f24e2217e1fc
Component: engine
2016-08-20 16:19:05 +03:00
1625a6329f Make it clear who is doing variable expansion
Add sentece to RUN, CMD, and ENTRYPOINT exec sections making it clear
that it is the shell doing the environment variable expansion.

Signed-off-by: David Dooling <dooling@gmail.com>
Upstream-commit: 20e336efac147f7cc565eeb4c68beb6ccf905e50
Component: engine
2016-08-17 06:31:19 -05:00
06ad6e4384 Remove erroneous ENTRYPOINT note
The Dockerfile parser does not subsitute ENV variables in any form of
the ENTRYPOINT command.  Any substitution, if done, is done by the shell
when the command is executed.

Signed-off-by: David Dooling <dooling@gmail.com>
Upstream-commit: f44d78b47838204b85204711d014b7f4cf7826ec
Component: engine
2016-08-16 15:24:41 -05:00
d9de7815ff Update ENTRYPOINT/CMD table to agree with docs
Several other places in the document it states that when using the shell
form of ENTRYPOINT, CMD and command line arguments are ignored.  That is
accurate, this table was not.  It is now.

Signed-off-by: David Dooling <dooling@gmail.com>
Upstream-commit: 28e01950a22f0c21b7072bae4812b21763072d87
Component: engine
2016-08-16 15:23:59 -05:00
11cd397072 healthcheck: do not interpret exit code 2 as "starting"
Instead reserve exit code 2 to be future proof, document that it should
not be used. Implementation-wise, it is considered as unhealthy, but
users should not rely on this as it may change in the future.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 91e9f3831330c63f8351b9fc3f7c31b3229505be
Component: engine
2016-07-25 14:28:45 -07:00
2fa3ccc004 Fix some broken sourceforge.net links
Looks like there's issues with sourceforge project
pages. Given that sourceforge isn't really what
it used to be, trying to find alternative URLs
where possible.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0e7a1079be5e87aae2abcda7c27a2b0e67270a50
Component: engine
2016-07-12 21:51:14 +02:00
fb15fd3401 Clarify warning against using build-time variables for secrets
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Upstream-commit: 9af24ba3ac9c2efbb8ec7edef4668650a3c31834
Component: engine
2016-07-11 21:21:33 -04:00
0bdbf282f3 Fix spelling in comments, strings and documentation
Signed-off-by: Otto Kekäläinen <otto@seravo.fi>
Upstream-commit: 644a7426cc31c338fedb6574d2b88d1cc2f43a08
Component: engine
2016-07-03 20:58:11 +03:00
bea7ea0ca9 Fix error for env variables example in docker reference - 2
The reason why the issue occurs is because sh parses the first argument after -c as the whole script to execute.
Everything after isn't executed as one might expect.

When working on the 'fix' I found out the same fix is also done in commit 2af7c5cfe24b4c8e931f751979b5e69e20ba77e2, except only for one occurrence.

Signed-off-by: Serhat Gülçiçek <serhat+signoff@equil.nl>
Upstream-commit: 7a30fa7af6f0bb3850ce6167850642420b4c0633
Component: engine
2016-06-20 13:09:44 +02:00