Commit Graph

464 Commits

Author SHA1 Message Date
ec8d3f9fa9 Builder/dockerfile/dispatchers.go tests
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
Upstream-commit: 5ece81a72aea6797809303aa3b68871f6ae01f6e
Component: engine
2016-06-19 14:45:34 +02:00
02e6cd83ac Merge pull request #23322 from tkopczynski/20784-builder-dockerfile-symlink
Reimplement integration test for symlink Dockerfile as a unit test
Upstream-commit: e08aed59dfd1642ae04ac4eb1055a378d6a572c1
Component: engine
2016-06-15 10:52:49 +02:00
f0593ff496 Reimplement integration test for symlink Dockerfile as a unit test
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
Upstream-commit: 830584b011ebf75500f307efa5425cf63e89d713
Component: engine
2016-06-14 23:07:19 +02:00
dc116784a5 Merge pull request #23093 from tkopczynski/20784-builder-dockerfile-outside-context
Builder integration tests for Dockerfile outside context as a unit test
Upstream-commit: 7d988a7aa6ae20020f0f96c6e2a47377e3567a3d
Component: engine
2016-06-14 08:44:24 +02:00
394bb94714 Fixed spelling error in builder/dockerfile/parser/parser.go
Signed-off-by: Tiffany Jernigan <tiffany.f.j@gmail.com>
Upstream-commit: a07c57f656846ee0de67ac4f575fe5b76d482efb
Component: engine
2016-06-09 14:49:59 -07:00
1a51605407 Support unicode characters in parseWords
Signed-off-by: Jonathan Stoppani <jonathan.stoppani@divio.com>
Upstream-commit: 6284f04a6b3a9b8127dc166ff84b102c8ad411ce
Component: engine
2016-06-08 14:05:08 +02:00
86b04a6a8a Merge pull request #22489 from Microsoft/jjh/shell
Builder shell configuration
Upstream-commit: df1dd1322d5c9527be7187038ca3480404b1282b
Component: engine
2016-06-05 17:43:12 +02:00
1a8439b6fb Reimplementing builder tests for Dockerfile outside context as a unit test
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
Upstream-commit: fb175bb36793ad59f2cfe9b2d92d636027fb836b
Component: engine
2016-06-05 08:39:06 +02:00
f88056a4aa Merge pull request #23232 from thaJeztah/update-default-retries
Healthcheck: set default retries to 3
Upstream-commit: 3db23a4eaf19d347c486f0f0ae764ea1b84491c0
Component: engine
2016-06-04 07:50:04 +02:00
d5ece41dcd Builder default shell
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: b18ae8c9ccc2eb6cf8aa947f25eb6f1d20089776
Component: engine
2016-06-03 13:54:31 -07:00
ab25cb22b0 Skip UTF-8 BOM bytes from Dockerignore if exist
This fix tries to address issues related to #23221 where Dockerignore
may consists of UTF-8 BOM. This likely happens when Notepad
tries to save a file as UTF-8 in Windows.

This fix skips the UTF-8 BOM bytes from the beginning of the
Dockerignore if exists.

Additional tests has been added to cover the changes in this fix.

This fix is related to #23221 (UTF-8 BOM in Dockerfile).

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: ea86320fcc61ea9ded3eef7ba01699c4e3ccf3ce
Component: engine
2016-06-03 07:26:36 -07:00
2c68691b95 Skip UTF-8 BOM bytes from Dockerfile if exists
This fix tries to address issues in #23221 where Dockerfile
may consists of UTF-8 BOM. This likely happens when Notepad
tries to save a file as UTF-8 in Windows.

This fix skips the UTF-8 BOM bytes from the beginning of the
Dockerfile if exists.

Additional tests has been added to cover the changes in this
fix.

This fix fixes #23221.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 678c80f9256021ce74184fdd6b612d9dea377fba
Component: engine
2016-06-03 06:16:50 -07:00
52ca58bbaa Healthcheck: set default retries to 3
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 50e470fab4ebdffff74bafeefa2f7fb8c21da13e
Component: engine
2016-06-03 13:28:08 +02:00
3dff30ced8 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: 8913dace341c8fc9f9a3ab9518c8521c161b307f
Component: engine
2016-06-02 19:06:52 -07:00
4524589dc5 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: b6c7becbfe1d76b1250f6d8e991e645e13808a9c
Component: engine
2016-06-02 23:58:34 +02:00
e9a370108d Fix directory walker error checking
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 81d24e754d48ac8e9f0e4fe02befbf628179da43
Component: engine
2016-05-26 14:59:38 -07:00
5bcb28804b Merge pull request #22268 from Microsoft/jjh/continuationescape
Support platform semantic file paths through ESCAPE
Upstream-commit: 8e924153e219d040e3aa672df4e0c7baff9f8d8b
Component: engine
2016-05-26 10:00:56 -07:00
dd19106ac3 Typo fix wiildcard -> wildcard
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
Upstream-commit: 86d48aa111384539b0d2bd50353c4d4c40a5750a
Component: engine
2016-05-22 18:39:35 +01:00
4197623885 Reimplementing more builder integration tests as unit tests
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
Upstream-commit: cf2611f3239d18919e437e82554cec178028612e
Component: engine
2016-05-22 01:00:57 +02:00
886f3ce26b Support platform file paths through escape
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: e8e3dd32c5bad727010ec787f484b98942977531
Component: engine
2016-05-20 20:29:59 -07:00
084ac6917b builder: fixed workdir comment
Signed-off-by: Wendel Fleming <wfleming@usc.edu>
Upstream-commit: 131161bbc7a153eac0eccf02fcfb0fc2f5d368b5
Component: engine
2016-05-19 15:40:46 -05:00
e033d6beca Merge pull request #22462 from Microsoft/jjh/22181unittests
Windows: Reduce CLI time, move some to unit tests
Upstream-commit: 9de21de4531e01169d903751ab48a29457769610
Component: engine
2016-05-13 00:27:29 +02:00
af05fef951 Reimplementing builder integration tests as unit tests
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
Upstream-commit: 18eeb399852b7efe9459a1d77b0a5032a6b88bba
Component: engine
2016-05-11 22:13:39 +02:00
16a036804f Merge pull request #22485 from tkopczynski/test-utils
Builder unit tests refactoring
Upstream-commit: 16d0a8959381f7bc7c0fb9afbb9dd2f75431d48a
Component: engine
2016-05-06 22:05:02 +02:00
d1aa34c3d1 Windows: Reduce CLI time, move some to unit tests
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: faab71701f710a8862e71d4ecd6a86cef49f67b9
Component: engine
2016-05-06 12:26:08 -07:00
b06eb99229 Windows: Support ARG in builder
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 6b5c83bf18fe406e397c001acb0a1d9d7e147fd9
Component: engine
2016-05-04 14:32:23 -07:00
dfa93d10b9 Builder unit tests refactoring
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
Upstream-commit: ab2baf08f03b4a1ccede84b1e902dd16d1ad946f
Component: engine
2016-05-03 19:00:35 +02:00
263f748b31 Unit test for builder/remote.go
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
Upstream-commit: e00ad7227ea1ea09506145901213640964e7bdfb
Component: engine
2016-05-03 10:20:10 +02:00
7cba2b7aed Merge pull request #22181 from Microsoft/jjh/workdir
Windows: Consistent build workdir handling
Upstream-commit: 2b97201e0cd8301484fde379d2bf7f0ad3f36f10
Component: engine
2016-04-26 16:51:09 -07:00
51ef85c587 Windows: Consistent build workdir handling
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 0433801093f1988db0e210e28352f4af71a0ac81
Component: engine
2016-04-26 15:32:52 -07:00
70a36f55d4 Labels set on the command line always override labels in Dockerfile
This fix tries to address the inconsistency in #22036 where labels
set on the command line will not override labels specified in
Dockerfile, but will override labels inherited from `FROM` images.

The fix add a LABEL with command line options at the end of the
processed Dockerfile so that command line options labels always
override the LABEL in Dockerfiles (or through `FROM`).

An integration test has been added for test cases specified in #22036.

This fix fixes #22036.

NOTE: Some changes are from #22266 (@tiborvass).

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 5844736c14b29860ea03b040e9a052e59ad75bfc
Component: engine
2016-04-23 18:49:17 -07:00
59ebbd5d31 Merge pull request #21817 from tkopczynski/20784-builder-dockerfile-support
Unit tests for builder/dockerfile/support
Upstream-commit: 27dd6a10b8515ed464e11ba409dd8c03b2287d1d
Component: engine
2016-04-16 13:34:35 +02:00
870f41bf45 Unit tests for builder/dockerfile/support
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
Upstream-commit: d0ebc58b9c82d2baf0c672b514ba9733ff79a3a1
Component: engine
2016-04-16 00:19:58 +02:00
16e418c586 Merge pull request #21633 from tkopczynski/20784-builder-tarsum-tests
Builder/tarsum unit tests
Upstream-commit: c60c3045ddf719a8e486e9f1bf69c634a05724b9
Component: engine
2016-04-15 12:53:07 -04:00
a683195dbd Merge pull request #21726 from aaronlehmann/tarsum-filename-normalization
Fix build cache false positives when build context tar contains unnormalized paths
Upstream-commit: 1a14bbc61e35fd2ca412e07fa6c456095756f892
Component: engine
2016-04-15 09:45:26 -07:00
b1c3afb97e Fix build cache false positives when build context tar contains unnormalized paths
If a build context tar has path names of the form 'x/./y', they will be
stored in this unnormalized form internally by tarsum. When the builder
walks the untarred directory tree and queries hashes for each relative
path, it will query paths of the form 'x/y', and they will not be found.

To correct this, have tarsum normalize path names by calling Clean.

Add a test to detect this caching false positive.

Fixes #21715

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 8691a77e441996fef96019b94f299a11b7244080
Component: engine
2016-04-14 17:57:45 -07:00
4447d74a76 Move build endpoint handler from daemon (#21972)
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 73ac6d199cacbcdba4c062f982b31f8d57e03f3c
Component: engine
2016-04-13 10:21:00 -07:00
30ee59a24a Merge pull request #21867 from calavera/remove_reference_from_api
Remove reference package dependency from the api.
Upstream-commit: 681b5e0ed45f535d123d997884ce4ffb2907932f
Component: engine
2016-04-07 21:56:43 -04:00
fd446e3c8a Merge pull request #21815 from Microsoft/jjh/fixunittest
Windows: Fix failing unit tests
Upstream-commit: 3e14070c880dc1f3d9ca81c55f84ccebe8d89ad2
Component: engine
2016-04-07 21:14:42 -04:00
956e3c675e Remove reference package dependency from the api.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 47afe6bd0a0dc806c36d0978a8d3e23f75ef87fe
Component: engine
2016-04-07 15:01:23 -07:00
69969b53e0 Windows: Fix failing unit tests
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: ccd0da908ac2b0743ca2c8e80c589295fd3b2563
Component: engine
2016-04-06 13:42:15 -07:00
9f10b4351a Windows: Remove TP4 support from main code
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 331c8a86d489e573fcbf1df3c4f813bbc3168624
Component: engine
2016-04-06 12:12:20 -07:00
d2a9e8f78b Merge pull request #21669 from msabansal/expose
Enabling expose support for Windows TP5
Upstream-commit: f3da0c9055ea73dec1d793d4ff524a58ad67f635
Component: engine
2016-04-06 07:52:07 -07:00
3a408aad61 Enabling expose support for Windows TP5
Signed-off-by: msabansal <sabansal@microsoft.com>
Upstream-commit: 4982a732f34640217d05eee255905fcb12a7f939
Component: engine
2016-03-30 17:25:41 -07:00
783220b8bb Apply build labels to images with only a FROM tag.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 1a85c8ebbe1ab508bcd47b883b9732c032509503
Component: engine
2016-03-30 17:28:13 -04:00
055639ebe7 Merge pull request #21574 from tkopczynski/20784-builder-context-tests
Builder/context unit tests
Upstream-commit: 8dabc0c39b868e1c80f85541bbeeac17f05ca88f
Component: engine
2016-03-30 14:04:51 -04:00
7a2a6e9f8c Builder/tarsum unit tests
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
Upstream-commit: 61ca9cc99e1e7ba18c0d04237ba5fbcf30e3bd74
Component: engine
2016-03-30 06:40:40 +02:00
5a3dd03f44 Dockerignore tests
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
Upstream-commit: 555d8cb293705bd2ad2d8cac7881616756eca767
Component: engine
2016-03-28 22:31:35 +02:00
da12710ee0 Builder/context unit tests
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
Upstream-commit: 593e29156dcda362e4e4b9a95b4fce22a024ba79
Component: engine
2016-03-28 13:47:19 +02:00
35980664e6 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 6983f05b42527dec87de9b2ecaf1d948038860fc
Component: engine
2016-03-26 22:06:45 +08:00