Commit Graph

64 Commits

Author SHA1 Message Date
a29051ebb7 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: 1a8bdcd36f
Component: cli
2017-06-02 00:10:11 +00:00
b82795e935 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: 4785157d54
Component: cli
2017-06-02 00:10:11 +00:00
a076b13e84 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: e1a8e15e8d
Component: cli
2017-06-02 00:10:09 +00:00
e6d55c9096 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: 62f35ffbdc
Component: cli
2017-06-02 00:10:09 +00:00
6cf494a56a 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: 98043e3f79
Component: cli
2017-06-02 00:10:09 +00:00
0a5d2abad1 Fix typo in builder.md
Signed-off-by: Kris-Mikael Krister <krismikael@protonmail.com>
Upstream-commit: 8918ff39e2
Component: cli
2017-06-02 00:10:07 +00:00
9b96f27cba 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: e6c152e5ee
Component: cli
2017-06-02 00:10:06 +00:00
397cc42a3c 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: 2b84c776d0
Component: cli
2017-06-02 00:10:06 +00:00
5809cc0e24 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: 6132c35c04
Component: cli
2017-06-02 00:10:06 +00:00
473d443e38 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: fa9465f093
Component: cli
2017-06-02 00:10:02 +00:00
ce34426306 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: b41c0c8696
Component: cli
2017-06-02 00:07:50 +00:00
b11bc7e580 Clarify warning against using build-time variables for secrets
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Upstream-commit: e8b87f53ec
Component: cli
2017-06-02 00:07:49 +00:00
80567c7095 Fix spelling in comments, strings and documentation
Signed-off-by: Otto Kekäläinen <otto@seravo.fi>
Upstream-commit: 8e2c3efc58
Component: cli
2017-06-02 00:07:48 +00:00
12701ff2ab 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: beb09f42d6
Component: cli
2017-06-02 00:07:47 +00:00
e1cb76e0ab surfacing Learn by example topics to top level of Docker Engine docs
fixing links after moving surfacing tutorials

fixing more links for the newly located tutorials

Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
Upstream-commit: d3b7a2779e
Component: cli
2017-06-02 00:07:43 +00:00
2192c65f15 typo in builder.md: its => it's
Signed-off-by: Kevin Burke <kev@inburke.com>
Upstream-commit: 26fdf31cf8
Component: cli
2017-06-02 00:07:43 +00:00
c1b5141a07 Builder default shell
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 0cb3440a21
Component: cli
2017-06-02 00:07:41 +00:00
7291a7792b Healthcheck: set default retries to 3
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7e00f19c4f
Component: cli
2017-06-02 00:07:41 +00:00
8d1fcd5543 Add support for comment in .dockerignore
This fix tries to address the issue raised in #20083 where
comment is not supported in `.dockerignore`.

This fix updated the processing of `.dockerignore` so that any
lines starting with `#` are ignored, which is similiar to the
behavior of `.gitignore`.

Related documentation has been updated.

Additional tests have been added to cover the changes.

This fix fixes #20083.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 1a22098ae2
Component: cli
2017-06-02 00:07:41 +00:00
4231660e73 Add support for user-defined healthchecks
This PR adds support for user-defined health-check probes for Docker
containers. It adds a `HEALTHCHECK` instruction to the Dockerfile syntax plus
some corresponding "docker run" options. It can be used with a restart policy
to automatically restart a container if the check fails.

The `HEALTHCHECK` instruction has two forms:

* `HEALTHCHECK [OPTIONS] CMD command` (check container health by running a command inside the container)
* `HEALTHCHECK NONE` (disable any healthcheck inherited from the base image)

The `HEALTHCHECK` instruction tells Docker how to test a container to check that
it is still working. This can detect cases such as a web server that is stuck in
an infinite loop and unable to handle new connections, even though the server
process is still running.

When a container has a healthcheck specified, it has a _health status_ in
addition to its normal status. This status is initially `starting`. Whenever a
health check passes, it becomes `healthy` (whatever state it was previously in).
After a certain number of consecutive failures, it becomes `unhealthy`.

The options that can appear before `CMD` are:

* `--interval=DURATION` (default: `30s`)
* `--timeout=DURATION` (default: `30s`)
* `--retries=N` (default: `1`)

The health check will first run **interval** seconds after the container is
started, and then again **interval** seconds after each previous check completes.

If a single run of the check takes longer than **timeout** seconds then the check
is considered to have failed.

It takes **retries** consecutive failures of the health check for the container
to be considered `unhealthy`.

There can only be one `HEALTHCHECK` instruction in a Dockerfile. If you list
more than one then only the last `HEALTHCHECK` will take effect.

The command after the `CMD` keyword can be either a shell command (e.g. `HEALTHCHECK
CMD /bin/check-running`) or an _exec_ array (as with other Dockerfile commands;
see e.g. `ENTRYPOINT` for details).

The command's exit status indicates the health status of the container.
The possible values are:

- 0: success - the container is healthy and ready for use
- 1: unhealthy - the container is not working correctly
- 2: starting - the container is not ready for use yet, but is working correctly

If the probe returns 2 ("starting") when the container has already moved out of the
"starting" state then it is treated as "unhealthy" instead.

For example, to check every five minutes or so that a web-server is able to
serve the site's main page within three seconds:

    HEALTHCHECK --interval=5m --timeout=3s \
      CMD curl -f http://localhost/ || exit 1

To help debug failing probes, any output text (UTF-8 encoded) that the command writes
on stdout or stderr will be stored in the health status and can be queried with
`docker inspect`. Such output should be kept short (only the first 4096 bytes
are stored currently).

When the health status of a container changes, a `health_status` event is
generated with the new status. The health status is also displayed in the
`docker ps` output.

Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 51ddea93a2
Component: cli
2017-06-02 00:07:41 +00:00
1b53e94231 Support platform file paths through escape
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 1bc54f3466
Component: cli
2017-06-02 00:07:40 +00:00
d9def6c55e Docs: JSON vs Shell clarification
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 560134b63a
Component: cli
2017-06-02 00:07:39 +00:00
d1c631b863 Fix error for env variables example in docker reference
Signed-off-by: Charles Law <claw@conduce.com>
Upstream-commit: cf70da5d08
Component: cli
2017-06-02 00:07:38 +00:00
e811a0b92a Correct docs for a docker container's clean-up.
The 'Unix Signals' (https://en.wikipedia.org/wiki/Unix_signal#Handling_signals) wiki explains that:
> 'There are two signals which cannot be intercepted and handled: SIGKILL and SIGSTOP.'

Signed-off-by: kevinmeredith <kevin.m.meredith@gmail.com>
Upstream-commit: a8e16c0079
Component: cli
2017-06-02 00:07:38 +00:00
591f4efdfb Improve build cache miss doc for ARG and RUN
The documentation already says the cache miss happens only at `ARG`
variable usage, not declaration, but there is a very common implicit
usage: `RUN`, which this commit documents even more, improving on #21790.

Also, use `definition` instead of `declaration`: it's the same thing, and
`definition` is already used in this documentation, contrary to
`declaration`.

Also, distinguish between "instructions" and "variables defined by `ARG`
instructions".

Signed-off-by: Thomas Riccardi <riccardi@systran.fr>
Upstream-commit: 6ded7e8279
Component: cli
2017-06-02 00:07:36 +00:00
4f10a582f9 make the cache miss clear
Signed-off-by: mikelinjie <294893458@qq.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: bc060f1f19
Component: cli
2017-06-02 00:07:35 +00:00
9f81de4a0d WORKDIR is like calling mkdir - but we've not told people
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
Upstream-commit: 80f5ed58a5
Component: cli
2017-06-02 00:07:33 +00:00
1b6340da4f Docs: add note about CMD and ENTRYPOINT commands
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
Upstream-commit: a429c0e84f
Component: cli
2017-06-02 00:07:30 +00:00
f04b25ded8 add missing trailing slash in ADD and COPY /absoluteDir examples. According to the specs they are mandatory.
Signed-off-by: Bastiaan Bakker <bbakker@xebia.com>
Upstream-commit: e56ee5769c
Component: cli
2017-06-02 00:07:29 +00:00
db47f91e5b fix common misspell
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: c30d9d2fff
Component: cli
2017-06-02 00:07:28 +00:00
38ad8ed13a Fix typo
Signed-off-by: Prayag Verma <prayag.verma@gmail.com>
Upstream-commit: 6f24713ba0
Component: cli
2017-06-02 00:07:27 +00:00
b82ff962b6 Creating Engine specific menu
Fixing the links
Updating with Seb's comments
Adding weight
Fixing the engine aliases
Updating after Arun pushed
Removing empty file

Signed-off-by: Mary Anthony <mary@docker.com>
Upstream-commit: 7910f01804
Component: cli
2017-06-02 00:07:26 +00:00
4980c17b3e Add some helper text for magical ADD
Closes: #15777

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: fc57c3a419
Component: cli
2017-06-02 00:07:25 +00:00
20429a2b3a Fix ambassador script based on SvenDowideit/dockerfiles#37
Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
Upstream-commit: 5142d3a669
Component: cli
2017-06-02 00:07:23 +00:00
6be47e4a6c Add some docs about build-arg's impact on the cache
Closes #18017

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: ec3aa7ede2
Component: cli
2017-06-02 00:07:18 +00:00
6d7ca0ef19 Fixes found by docs validation tool
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
Upstream-commit: d63c19c4ea
Component: cli
2017-06-02 00:07:18 +00:00
5f568c0605 Support multi-dir wildcards in .dockerignore
Closes #13113

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 4978171903
Component: cli
2017-06-02 00:07:17 +00:00
8050e305f6 First pass at consolidating
Removing old networking.md
Updating dockernetworks.md with images
Adding information on network plugins
Adding blurb about links to docker networking
Updating the working documentation
Adding Overlay Getting Started
Downplaying links by removing refs/examples, adding refs/examples for network.
Updating getting started to reflect networks not links
Pulling out old network material
Updating per discussion with Madhu to add Default docs section
Updating with bridge default
Fix bad merge
Updating with new cluster-advertise behavior
Update working and NetworkSettings examples
Correcting example for default bridge discovery behavior
Entering comments
Fixing broken Markdown Syntax
Updating with comments
Updating all the links

Signed-off-by: Mary Anthony <mary@docker.com>
Upstream-commit: 02a859b9f3
Component: cli
2017-06-02 00:07:15 +00:00
e16c15092c Add ability to add multiple tags with docker build
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: 9d9976ae3a
Component: cli
2017-06-02 00:07:14 +00:00
9e47fd5a5a Update ambassador image, use the socat -t option
Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
Upstream-commit: edbb82c900
Component: cli
2017-06-02 00:07:14 +00:00
900900b4d7 updating docs for EXPOSE option on run command; fixes #16634
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
Upstream-commit: d83594a46d
Component: cli
2017-06-02 00:07:12 +00:00
d4f3c46baf Enabled GitHub Flavored Markdown
GitHub flavored markdown is now supported for links and images. Also, ran LinkChecker and FileResolver. Yay!
Fixes from Spider check
Output for docker/docker now goes into engine directory

Signed-off-by: Mary Anthony <mary@docker.com>
Upstream-commit: e641a0f363
Component: cli
2017-06-02 00:07:12 +00:00
690359813b clarify dockerignore semantics
Signed-off-by: Grant Reaber <grant.reaber@gmail.com>
Upstream-commit: 42fe72228d
Component: cli
2017-06-02 00:07:11 +00:00
0e98ff8444 Mention more realistic examples are available
Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
Upstream-commit: d86cfdfb84
Component: cli
2017-06-02 00:07:11 +00:00
49281f044b Don't put dockerfiles in one continuous code block
Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
Upstream-commit: 090ad2bb8a
Component: cli
2017-06-02 00:07:11 +00:00
ddf084d760 Touch up "Dockerfile reference"
- add example for `docker build -f ...`
- modifiy `FROM` explaination into bullet points
- add/clarify examples for `LABEL` and `ADD` instructions
- fix review comments (PR #16109)

Signed-off-by: Charles Chan <charleswhchan@users.noreply.github.com>
Upstream-commit: 0039e46e3e
Component: cli
2017-06-02 00:07:10 +00:00
6a2b5a7a84 Add documentation note that LABEL allows environment replacement
Signed-off-by: Tim Waugh <twaugh@redhat.com>
Upstream-commit: a8db81a89a
Component: cli
2017-06-02 00:07:10 +00:00
0a7b038a58 incorporate doc review comments
Signed-off-by: Madhav Puri <madhav.puri@gmail.com>
Upstream-commit: 9fab23902f
Component: cli
2017-06-02 00:07:09 +00:00
a49195f1d6 Support for passing build-time variables in build context
- The build-time variables are passed as environment-context for command(s)
run as part of the RUN primitve. These variables are not persisted in environment of
intermediate and final images when passed as context for RUN. The build environment
is prepended to the intermediate continer's command string for aiding cache lookups.
It also helps with build traceability. But this also makes the feature less secure from
point of view of passing build time secrets.

- The build-time variables also get used to expand the symbols used in certain
Dockerfile primitves like ADD, COPY, USER etc, without an explicit prior definiton using a
ENV primitive. These variables get persisted in the intermediate and final images
whenever they are expanded.

- The build-time variables are only expanded or passed to the RUN primtive if they
are defined in Dockerfile using the ARG primitive or belong to list of built-in variables.
HTTP_PROXY, HTTPS_PROXY, http_proxy, https_proxy, FTP_PROXY and NO_PROXY are built-in
variables that needn't be explicitly defined in Dockerfile to use this feature.

Signed-off-by: Madhav Puri <madhav.puri@gmail.com>
Upstream-commit: 40a2dac738
Component: cli
2017-06-02 00:07:09 +00:00
6a0da0245a update documentation styling as per suggestions
Signed-off-by: Amen Belayneh <amenbelayneh@gmail.com>
Upstream-commit: 8ff51d3827
Component: cli
2017-06-02 00:07:09 +00:00