Commit Graph

268 Commits

Author SHA1 Message Date
e7731ac431 Fix TestBuildCancelationKillsSleep to not fail on Windows
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: d38c90140b8330bd355c40a0c8d1e9bd2b3664ec
Component: engine
2015-04-09 21:03:19 +02:00
adca7cca6d fix up Image-name related issues in docker ps and CI
This patch include the following fixs:
 - fix image name error when docker ps
 - fix docker events test failure: use the exact image name for filter
 - fix docker build CI test failure due to "docker events" change

Because of change of daemon log behavior. Now we record
the exact Image name as you typed. So docker run -d busybux sh
and docker run -d busybox:latest are not the same in the log.
So it will affect the docker events. So change the related CI

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Upstream-commit: 645c020f5ab7119cd06d7c6a790e9d99fe1cd309
Component: engine
2015-04-09 23:03:23 +08:00
a714c4cf33 Merge pull request #12107 from cpuguy83/remove_striptrailingchars
Remove `stripTrailingCharacters` from tests
Upstream-commit: b9d2ede4d4dc67b97abd0254a9e431aa9c89b932
Component: engine
2015-04-06 08:46:08 -07:00
ab9a366f0e Remove stripTrailingCharacters from tests
This was just an alias to `strings.TrimSpace`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 475c65319b4663d630711519e18d0b134c42c7f1
Component: engine
2015-04-06 09:21:18 -04:00
3e035d76a2 Add support for more advanced ${xxx:...} syntax
Just ${xxx:+...} and ${xxx:-...} for now

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 39908fc6d9a13f0d44196475ba938b6cc352fdbe
Component: engine
2015-04-01 08:11:15 -07:00
5897cb3c81 Clean up integration-cli tests
My AR couldn't take it any more:
- one logDone per test
- PASSED lines don't wrap

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 9a9d23dbc40c9b650bd1f9f98a421b7ff2312f36
Component: engine
2015-03-26 17:25:50 -07:00
d4e188856d Fix TestBuildResourceConstraintsAreUsed Cpuset test
Set cpuset to "0" so that it works on single core machines.
W/o this (and set to "1") we'll see something like this error
when running:
System error: write /cgroup/cpuset/docker/66689499bbd08cd8dccc9b7bfd1d6b34e85d73ce8c84d3c69b5e91944322da60/docker/79d7c548b58c85c4cfad6cd01eb7c3b30db254d1014c496137edd93ddc528a6f/cpuset.cpus: invalid argument"

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 389d0ae45327926a9d20b2a3e6c15499f3c9c570
Component: engine
2015-03-26 07:31:39 -07:00
abd71318ca Revert "Dealing with trailing whitespaces"
The validation script from #10681 is too pedantic, and does not handle
well situations like:

```
cat <<EOF   # or <<-EOF
	Whether the leading whitespace is stripped out or not by bash
	it should still be considered as valid.
EOF
```

This reverts commit 4e65c1c319afffc325853b88c9aef0c42ec83482.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 0252ad0adc37a34b88fa908ae74a13b940febdcb
Component: engine
2015-03-25 10:04:56 -06:00
8e0111a19d Merge pull request #11737 from duglin/FixTestOutput
TestBuildCancelationKillsSleep sends exec cmd to stdout
Upstream-commit: f08e9f44a9d27dfd3780e8c3d89b0236f7672688
Component: engine
2015-03-25 08:45:09 -07:00
944966da9a fix 2 integration tests on lxc
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: c959d26d2f413fa93b60174c4e19111eff0a845d
Component: engine
2015-03-24 21:12:16 -07:00
5e050af7a5 TestBuildCancelationKillsSleep send exec cmd to stdout
and makes the testing output ugly.

This hides the output since it not used.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: fbd47969a86793c4e87e2da1abea1f806ba0a526
Component: engine
2015-03-24 20:56:26 -07:00
1e47557825 Refactor pkg/common, Fixes #11599
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: b80fae735684406d848b16a0f148a746e17ed25f
Component: engine
2015-03-24 18:19:59 +01:00
b27a399633 Cleanup "hello-world" image in build tests
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: bfc748221b15a0f6e42a6ab520ed6e31fa9e90c8
Component: engine
2015-03-23 15:16:13 -07:00
9b9105b3b2 Remove hardcoded error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 8b02d85e1728b48729b2fb8553b2ec4b56a30d37
Component: engine
2015-03-23 20:58:16 +01:00
69bd180001 Merge pull request #10431 from duglin/Issue10391
Clarify ENV non-recursivenes w.r.t. env var substitution + fix escaping
Upstream-commit: 61966d281bb715a2359b27bcd30d0d59c98d2812
Component: engine
2015-03-23 13:30:11 -05:00
9dcfa784ef Merge pull request #11538 from duglin/EmptyVolume
Check volume path to make sure its not the empty string
Upstream-commit: ded0ada9b47ab48b57d14225ec663e3756faff7f
Component: engine
2015-03-22 19:25:50 -07:00
088f0e2cb3 Merge pull request #9774 from pwaller/cancellation
Add basic build cancellation
Upstream-commit: 45ee402a631a59e2a33df7b2f63a49f6f3f84f09
Component: engine
2015-03-22 19:16:23 -07:00
7c1bfa9093 Implement build cancellation
Add the capability to cancel the build by disconnecting the client.

This adds a `cancelled` channel which is used to signal that a build
should halt. The build is halted by sending a Kill signal and noticing
that the cancellation channel is closed.

This first pass implementation does not allow cancellation during a
pull, but that will come in a subsequent PR.

* Add documentation of cancellation to cli and API

* Protect job cancellation with sync.Once

* Add TestBuildCancelationKillsSleep

* Add test case for build cancellation of RUN statements.

Signed-off-by: Peter Waller <p@pwaller.net>
Upstream-commit: 671c12204cb469d868f646da1474d5bad6541770
Component: engine
2015-03-22 11:31:28 +00:00
4a7e6e031f integ-cli: fix bug and race in TestBuildSpaces
`TestBuildSpaces` is used to do string manipulation to redact timestamps
from compared cmd output. However it was assuming there is going to be
only one `time=".."` in the output --not the case on windows. Therefore
I wrote a regexp to redact all log timestamps.

Also the test used to have a copy/paste bug (see err1/err2). This fixes
that, too.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 28a34dfffdce359a5674cfda0a90b25b1f4d4d97
Component: engine
2015-03-21 19:43:14 +00:00
bafff954ca Check volume path to make sure its not the empty string
With this Dockerfile
```
FROM ubuntu
ENV ABC=""
VOLUME $ABC
```

It builds ok but then at run time I get this error:

FATA[0002] Error response from daemon: Cannot start container 8902b4a7aaf5c4e4b11a38070d392db465fa97ad88c91c8b38dda5ab8149ccac: [8] System error: no such file or directory

Because the Volume config shows "" as the path.  This PR checks for "" as
the path and stops it at build time.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 8071bf396747d3ad01db504a417b75fe7a52608a
Component: engine
2015-03-20 21:39:49 -07:00
490a18c994 Fix some escaping around env var processing
Clarify in the docs that ENV is not recursive

Closes #10391

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 6d66e3e7a5ecb021a9e89c4f85fadecf23e2000c
Component: engine
2015-03-20 20:09:00 -07:00
632e09a6f3 Merge pull request #11397 from ahmetalpbalkan/win-cli/build-warning
Add cli build warning about chmod bits on windows
Upstream-commit: c536e5bfb4e8f501ec27a9cc6d55b64d8f1a1603
Component: engine
2015-03-20 19:19:38 -04:00
638765fe3b Add cli build warning about chmod bits on windows
This shows a warning message about adjusted file/directory permission bits
when the `docker build` cli command is executed on windows.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 4a8b3cad6096854027151dfbcfb4b2cd8841ad95
Component: engine
2015-03-20 20:13:32 +00:00
1198ecb944 Add LABEL config check to runconfig compare
Without this we won't do a proper cacche check because we skip the
labels part of the config.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: b4beb0637a61c6002bb3b0b1dc150899db3b44e4
Component: engine
2015-03-20 05:55:48 -07:00
bab50b4201 Add a LABEL cache check testcase
Thanks to @tiborvass's review of another PR it was noticed that
we didn't have a testcase to make sure the cache checking for LABEL
was being done properly.  This adds a test for it.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 97c573bf020e946fe1b9af61269f7f13f7f63f67
Component: engine
2015-03-19 19:18:00 -07:00
5e80a64076 Allow setting resource constrains for build
Closes #10191

Allow `docker build` to set --cpu-shares, --cpuset, --memory,
--memory-swap for all containers created by the build.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: e6ae89a45a699bd44f03517396777e34ec76018b
Component: engine
2015-03-18 20:57:13 -04:00
5f00f97ea0 Merge pull request #9882 from ibuildthecloud/labels
Proposal: One Meta Data to Rule Them All => Labels
Upstream-commit: b6ac111abfbed628a80b67f0b092a248083b354c
Component: engine
2015-03-16 20:20:05 -07:00
526e8c6e31 Merge pull request #10591 from duglin/ErrUnknownCmd
Generate an error on unknown Dockerfile instruction
Upstream-commit: 085054db9d8850a7d2c8658bb9a7fdacf7a3ceb8
Component: engine
2015-03-16 17:47:28 -04:00
f32b25fee3 Fix test pull verified
Update pull code to consider any layer download or new tag as an update.
Update hello-world frozen image to be explicitly tagged as frozen, to not interfere with pull tests.  The hello-world is used by pull tests because of its small size and there is no other official image with such a size.

fixes #11383

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 636037c3637eb1d09cc469cebe39ffb915bb0aa9
Component: engine
2015-03-16 12:22:00 -07:00
0a3eeb1d23 Generate an error on unknown Dockerfile instruction
Instead of just printing a warning and going on, this will generate
an error and stop processing.

This used to be part of #10561 but I decided it might need its own
independent discussion/PR as to not derail #10561.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 8a5b50d65dae2d0607e046c57241dd6b46b65c6a
Component: engine
2015-03-13 16:08:34 -07:00
51b13a7774 Allow specification of Label Name/Value pairs in image json content
Save "LABEL" field in Dockerfile into image content.

This will allow a user to save user data into an image, which
can later be retrieved using:

docker inspect IMAGEID

I have copied this from the "Comment" handling in docker images.

We want to be able to add Name/Value data to an image to describe the image,
and then be able to use other tools to look at this data, to be able to do
security checks based on this data.

We are thinking about adding version names,
Perhaps listing the content of the dockerfile.
Descriptions of where the code came from etc.

This LABEL field should also be allowed to be specified in the
docker import --change LABEL:Name=Value
docker commit --change LABEL:Name=Value

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: cdfdfbfb6223fdd5b319942d412caac6bc09cdeb
Component: engine
2015-03-13 09:47:09 -07:00
7f7a47b98e Merge pull request #11265 from duglin/ScratchSHfix
Fix builder when num of RUN args is 1
Upstream-commit: 565cff84b1ae13e21fa74af83e58d29bafbca47a
Component: engine
2015-03-12 09:30:56 -05:00
20b7c132ab Merge pull request #11278 from ahmetalpbalkan/win-cli/fakeGIT
integ-cli: use httpserver container for fakeGIT
Upstream-commit: 52f6da223839a5ac1fc003b259b74f6a02fc2858
Component: engine
2015-03-11 18:19:11 -07:00
e4aa3231a3 Update logrus to 0.6.6
Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <hugs@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 89e2e5fc55620634df3f2c9403594b0f701b0c5c
Component: engine
2015-03-11 11:29:13 -07:00
2c409e6dd8 Fix builder when num of RUN args is 1
FROM scratch
ADD echo /
RUN [ "echo" ]

will die with
  exec: "/bin/sh": stat /bin/sh: no such file or directory

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 645f8a32df3b5b22e5e194664a9f0733709714c9
Component: engine
2015-03-11 07:30:44 -07:00
546ad5a411 integ-cli: use httpserver container for fakeGIT
This change enables `fakeGIT()` to use the new `fakeStorage`
server which is automatically starting a container on the remote test
daemon machine using the git repo directory (when requested).

Fixes the following tests:

- `TestBuildApiLowerDockerfile`
- `TestBuildApiBuildGitWithF`
- `TestBuildApiDoubleDockerfile` (skipped on windows: NTFS case-insensitive)
- `TestBuildFromGIT` (still needs local server)

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 44ffb199d03f0d63a2c9ad05e9fd03a6a08c594d
Component: engine
2015-03-10 22:48:35 -07:00
9863597201 Use server.URL() instead of server.URL
Old way now returns the go type instead of the value

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 40c8e78757a75a9e251223f563fc5adb2bc9bf99
Component: engine
2015-03-09 17:00:45 -07:00
c53e223228 Merge pull request #11159 from duglin/LastModifiedTest
Add an HTTP Last-Modified header testcase
Upstream-commit: feb02a2bbf9b4b4eb8f68bcec652ac687195f462
Component: engine
2015-03-09 19:22:27 -04:00
a630d7f64a Merge pull request #10893 from ahmetalpbalkan/win-cli/BuildViaDockerfileURL-same-host-fix
integ-cli: Implement remote FakeStorage server for build via URL tests
Upstream-commit: 7c4951d552d25c0608c44d03529c6b8cbe5d1e06
Component: engine
2015-03-09 13:33:40 -07:00
60d13dc8cb integ-cli: Implement remote FakeStorage server for build via URL tests
Implemented a FakeStorage alternative that supports spinning
up a remote container on DOCKER_TEST_HOST to serve files over
an offline-compiled Go static web server image so that tests which
use URLs in Dockerfile can build them over at the daemon side.

`fakeStorage` function now automatically chooses if it should
use a local httptest.Server or a remote container.

This fixes the following tests when running against a remote
daemon:

- `TestBuildCacheADD`
- `TestBuildCopyWildcardNoFind`
- `TestBuildCopyWildcardCache`
- `TestBuildADDRemoteFileWithCache`
- `TestBuildADDRemoteFileWithoutCache`
- `TestBuildADDRemoteFileMTime`
- `TestBuildADDLocalAndRemoteFilesWithCache`
- `TestBuildADDLocalAndRemoteFilesWithoutCache`
- `TestBuildFromURLWithF`
- `TestBuildApiDockerFileRemote`

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 2e95bb5f1a65d90f412568d6df82a9e2cdd3e790
Component: engine
2015-03-09 12:03:55 -07:00
f84b953b72 Merge pull request #10813 from chenhanxiao/expose-warning-v2
dispatchers: warn user if try to use EXPOSE ip:hostPort:containerPort
Upstream-commit: 1ff904e045c9415bb6d109742cd7f78316d44fa6
Component: engine
2015-03-08 00:30:27 -05:00
8b5893c4a0 Merge pull request #11186 from ahmetalpbalkan/win-cli/TestBuild-case-sensitive-fix
integ-cli: skip case-sensitive dockerfile tests on windows
Upstream-commit: ecea4a9cc2ddc3e7af5ff3193548e0e8c36b528f
Component: engine
2015-03-06 13:43:01 -05:00
a0c6b78604 Merge pull request #11148 from ahmetalpbalkan/win-cli/chmod-x-fix
pkg/archive: adjust chmod bits on windows
Upstream-commit: a6ddb8de42c731ae8f9e0e1becc2a93a56158a58
Component: engine
2015-03-06 12:28:58 -05:00
b626dcd093 integ-cli: skip case-sensitive dockerfile tests on windows
The tests end up overwriting the `dockerfile` with `Dockerfile` since
windows filesystems are case-insensitive. The following methods are
skipped:

- TestBuildRenamedDockerfile
- TestBuildFromMixedcaseDockerfile

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: d046f56e8826f597ddd1752b9289d93b9054fa9d
Component: engine
2015-03-05 15:50:15 -08:00
bac4428faa dispatchers: warn user if try to use EXPOSE ip:hostPort:containerPort
We could use EXPOSE ip:hostPort:containerPort,
but actually it did as EXPOSE ::containerPort

commit 2275c833 already warned user on daemon side.
This patch will print warning message on client side.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Upstream-commit: 26e85b0db1b896e98071f121fb14b2c6d905ed4f
Component: engine
2015-03-04 21:09:50 -05:00
71919ac23a pkg/archive: adjust chmod bits on windows
This change modifies the chmod bits of build context archives built on
windows to preserve the execute bit and remove the r/w bits from
grp/others.

Also adjusted integ-cli tests to verify permissions based on the platform
the tests are running.

Fixes #11047.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 1a22418f9f1573ca8521831d52c8e0562cb3ef8f
Component: engine
2015-03-04 14:10:37 -08:00
9bfbeabd6c Add an HTTP Last-Modified header testcase
Make sure ADD uses the Last-Modified as the mtime of the file.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 5c05b5c992417cd7c6650b7dc785a06ca51ae228
Component: engine
2015-03-04 13:32:38 -08:00
bc3e4a6737 Support dockerfile and Dockerfile
Closes #10807

Adds support for `dockerfile` ONLY when `Dockerfile` can't be found.
If we're building from a Dockerfile via stdin/URL then always download
it a `Dockerfile` and ignore the -f flag.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 15924f238503ffe44e5fcb99415ff753a36e5971
Component: engine
2015-03-03 18:38:50 -08:00
b74aa8d071 Merge pull request #11029 from brahmaroutu/fixtest_10963
When --net=none enabled, the test uses local filesystem
Upstream-commit: bcbe70588d1ff3ff28d78d56e221ff1efb7bbc47
Component: engine
2015-02-26 17:30:02 -08:00
f720e9d2f5 When --net=none enabled, the test uses local filesystem
Closes #10963
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 17b6583a5a352d5cf6d8ba20b018dc96f231f476
Component: engine
2015-02-26 18:24:34 +00:00