Commit Graph

127 Commits

Author SHA1 Message Date
15fecb0bf3 More helpful error message when not sufficiently argumentative
The error message suggests you need one argument even when you
have provided one. Suggest having another argument.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: 4ce93940b7c2a640c94296f20352cf6f052d1028
Component: engine
2016-08-08 17:22:09 +01:00
bb00cee2aa Don't allow empty env names
Closes: #25281

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: e72c0137af63c2f5aecce48443e3b654a3895150
Component: engine
2016-08-01 10:25:51 -07:00
1c72cebc59 Merge pull request #23969 from tkopczynski/20784-builder-dockerfile-dispatchers-2
Builder dispatchers unit tests
Upstream-commit: 0fc062d31ea00286c49d2310e245b6bb7b4a16e1
Component: engine
2016-07-29 07:26:48 +02:00
16a63d94bb Move directive out of globals
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 755be795b4e48b3eadcdf1427bf9731b0e97bed1
Component: engine
2016-07-26 10:35:33 -07:00
f4ad386d76 Fix issue with test ordering for TestParseWords
`TestParseWords` needs to use the `tokenEscape` for one of the test
cases, but `tokenEscape` was not being set unless tests ran in a
specific order.
This sets a default value for `tokenEscape`... `\`... so that tests that
rely on this global are not affected by test ordering.

This is the simplest fix for these cases. Ideally the token should not
be set as a global but rather passed down, which is a much larger
change.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: df167d3ff04cdc90012c8ca39647662ad69e6715
Component: engine
2016-07-26 10:50:12 -04:00
e0f9de9c83 Builder dispatchers unit tests
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
Upstream-commit: 9408b205f5ac4779cbcc75f42de995668d373baa
Component: engine
2016-07-12 07:40:25 +02:00
f7a6ca3323 Merge pull request #22868 from Microsoft/jjh/dockerfilecmd
Windows: CMD not honouring arg escaping
Upstream-commit: 6167a9ab166ce1e6fd0ffa653b9476d33983f15b
Component: engine
2016-07-07 09:21:26 -07:00
e4dfc2d04c Validate hostname starting from 1.24 API.
In order to keep a little bit of "sanity" on the API side, validate
hostname only starting from v1.24 API version.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6daf3d2a783fd042e870c8af8bbd19fc28989505
Component: engine
2016-07-06 09:13:59 +02: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
9de77e3319 Fix Malformed history layer - missing Sprintf in append of shell in Builder run config
Signed-off-by: Dan Feldman <danf@jfrog.com>
Upstream-commit: 29b6a696604d5bc80d1722e3ba123558bce7c7c9
Component: engine
2016-06-28 11:09:39 +03:00
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
610f859f67 Windows: CMD not honouring arg escaping
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: d05d0211bcf43d4519bfcbbc6029fafa122f86b7
Component: engine
2016-06-15 16:46:32 -07: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
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
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
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
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
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
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
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
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
43dd16ffb4 builder: replace cancelled channel with net/context
Also stop execution of run immediately if request was cancelled.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: f2401a0f6960734093be307a27bba85a3c2ecfcd
Component: engine
2016-03-25 08:19:29 -07:00
6cee95ae99 Merge pull request #21268 from calavera/remove_dockerfile_from_api
Remove dockerfile dependency from the API.
Upstream-commit: 5ef04b1c6d1ca94c83c7ce52faae908a278ce6ea
Component: engine
2016-03-23 19:34:21 -07:00
02220a45c4 Merge pull request #21270 from ehazlett/resource-labels
Add Label support for Images (build), Networks and Volumes on Creation
Upstream-commit: 53d2e5e9d754ce8fbef733759e9ec450514133e3
Component: engine
2016-03-22 15:12:33 -04:00
fe56b4ef22 add label support for build, networks and volumes
build: implement --label

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

network: allow adding labels on create

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

volume: allow adding labels on create

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

add tests for build, network, volume

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vendor: libnetwork and engine-api bump

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: fc214b4408d915e3510f61c7584ca01c176d1373
Component: engine
2016-03-22 11:49:06 -04:00
87c76eb0d7 Pass upstream client's user agent through to registry on operations beyond pulls
This adds support for the passthrough on build, push, login, and search.

Revamp the integration test to cover these cases and make it more
robust.

Use backticks instead of quoted strings for backslash-heavy string
contstands.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: c44e7a3e632c3ea961cb8c12ba45371f54e6699c
Component: engine
2016-03-21 14:31:47 -07:00
ae0977f1d1 fix variables that werent being called
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 0e025b4bb16c0d4cc6b3f0c040713d061b9b051a
Component: engine
2016-03-17 13:19:55 -07:00