Commit graph

440 commits

Author SHA1 Message Date
Arnaud Porterie
e960e4bb12 Merge pull request #11844 from jbarbier/cgroup-parent-42
Adding cgroup-parent option for docker build
2015-05-05 14:46:47 -07:00
David Calavera
0a2ccb1cb5 Merge pull request #12769 from calavera/git_build_fragment
Use git url fragment to specify build reference and dir context.
2015-05-04 12:48:24 -07:00
David Calavera
49fd83a25e Use git url fragment to specify reference and dir context.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-04 09:28:06 -07:00
Antonio Murdaca
4203230cbb c.Fatal won't fail and exit test inside a goroutine, errors should be handled outside with a channel
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-29 17:02:22 +02:00
buddhamagnet
6fd8e485c8 add support for exclusion rules in dockerignore
Signed-off-by: Dave Goodchild <buddhamagnet@gmail.com>
2015-04-28 18:56:45 +01:00
Doug Davis
82daa43844 Fix for Daemon crashing when wildcards are used for COPY/ADD
in the filename and the command itself

Closes #12267

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-27 19:09:57 -07:00
David Mackey
3941623fbc trivial: typo cleanup
Signed-off-by: David Mackey <tdmackey@booleanhaiku.com>
2015-04-27 13:35:08 -07:00
Nathan LeClaire
9dbe12b792 Migrate integration test to new method
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-04-25 17:12:01 -04:00
Nathan LeClaire
65aba0c9d6 Add dep to test
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-04-25 15:25:52 -04:00
Nathan LeClaire
f039c699a4 Fix gofmt
Mischevious comma is mischevious

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-04-25 15:25:52 -04:00
Marianna
f40dd69c97 Add test for cgroup parent flag for build
Signed-off-by: Marianna <mtesselh@gmail.com>
2015-04-25 15:25:52 -04:00
Alexander Morozov
a9688cdca5 Implement teardown removeAllImages
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-24 10:37:21 -07:00
Lei Jitang
5f4fb8be00 Add cpu cfs quota to build
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-24 08:54:08 +08:00
Alexander Morozov
799cf056e7 Merge pull request #11839 from brahmaroutu/template_11641
Allow go template to work properly with inspect …
2015-04-23 13:07:40 -07:00
Srini Brahmaroutu
231d362db7 Allow go template to work properly with inspect
Closes #11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-04-23 18:25:18 +00:00
Antonio Murdaca
ee7a7b07e7 Remove deleteAllContainers call in test
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-23 16:32:50 +02:00
Qiang Huang
b0ef3194aa fix inspect format result
Currently `docker inspect -f` use json.Unmarshal() unmarshal
to interface, it will store all JSON numbers in float64, so
we use `docker inspect 4f0d73b75a0d | grep Memory` and
`docker inspect -f {{.HostConfig.Memory}} 4f0d73b75a0d` will
get different values.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-23 09:28:07 +08:00
Brian Goff
f3680e7494 Cleanup daemon/volumes
- Mount struct now called volumeMount
- Merged volume creation for each volume type (volumes-from, binds, normal
  volumes) so this only happens in once place
- Simplified container copy of volumes (for when `docker cp` is a
  volume)

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-22 19:32:10 -04:00
Alexander Morozov
dc944ea7e4 Use suite for integration-cli
It prints test name and duration for each test.
Also performs deleteAllContainers after each test.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-21 10:28:52 -07:00
bobby abbott
621b601b3c Removed unnecessary error output from dockerCmd
Changed method declaration. Fixed all calls to dockerCmd
method to reflect the change.

resolves #12355

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
2015-04-17 09:11:14 -07:00
Qiang Huang
f8dc7e8754 Add cpuset-mems support for docker build
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-15 09:34:12 +08:00
Qiang Huang
c49cc1f2fb fix build test by adding --no-cache
Testcase TestBuildResourceConstraintsAreUsed run build without
--no-cache, so if you run this test twice, it will fail the
second time.
TESTFLAGS='-v -run ^TestBuildResourceConstraintsAreUsed$' ./hack/make.sh binary test-integration-cli
[PASSED]
TESTFLAGS='-v -run ^TestBuildResourceConstraintsAreUsed$' ./hack/make.sh binary test-integration-cli
[FAIL]
Because we'll use cID to inspect field and will get empty cID
if we have cache.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-13 16:24:49 +08:00
Antonio Murdaca
d38c90140b Fix TestBuildCancelationKillsSleep to not fail on Windows
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-09 21:03:19 +02:00
Liu Hua
645c020f5a 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>
2015-04-09 23:03:23 +08:00
Arnaud Porterie
b9d2ede4d4 Merge pull request #12107 from cpuguy83/remove_striptrailingchars
Remove `stripTrailingCharacters` from tests
2015-04-06 08:46:08 -07:00
Brian Goff
475c65319b Remove stripTrailingCharacters from tests
This was just an alias to `strings.TrimSpace`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-06 09:21:18 -04:00
Doug Davis
39908fc6d9 Add support for more advanced ${xxx:...} syntax
Just ${xxx:+...} and ${xxx:-...} for now

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-01 08:11:15 -07:00
Doug Davis
9a9d23dbc4 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>
2015-03-26 17:25:50 -07:00
Doug Davis
389d0ae453 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>
2015-03-26 07:31:39 -07:00
Tibor Vass
0252ad0adc 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 4e65c1c319.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-03-25 10:04:56 -06:00
Alexander Morozov
f08e9f44a9 Merge pull request #11737 from duglin/FixTestOutput
TestBuildCancelationKillsSleep sends exec cmd to stdout
2015-03-25 08:45:09 -07:00
Jessica Frazelle
c959d26d2f fix 2 integration tests on lxc
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-03-24 21:12:16 -07:00
Doug Davis
fbd47969a8 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>
2015-03-24 20:56:26 -07:00
Antonio Murdaca
b80fae7356 Refactor pkg/common, Fixes #11599
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-24 18:19:59 +01:00
Arnaud Porterie
bfc748221b Cleanup "hello-world" image in build tests
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-23 15:16:13 -07:00
Antonio Murdaca
8b02d85e17 Remove hardcoded error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-23 20:58:16 +01:00
Tibor Vass
61966d281b Merge pull request #10431 from duglin/Issue10391
Clarify ENV non-recursivenes w.r.t. env var substitution + fix escaping
2015-03-23 13:30:11 -05:00
Arnaud Porterie
ded0ada9b4 Merge pull request #11538 from duglin/EmptyVolume
Check volume path to make sure its not the empty string
2015-03-22 19:25:50 -07:00
Jessie Frazelle
45ee402a63 Merge pull request #9774 from pwaller/cancellation
Add basic build cancellation
2015-03-22 19:16:23 -07:00
Peter Waller
671c12204c 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>
2015-03-22 11:31:28 +00:00
Ahmet Alp Balkan
28a34dfffd 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>
2015-03-21 19:43:14 +00:00
Doug Davis
8071bf3967 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>
2015-03-20 21:39:49 -07:00
Doug Davis
6d66e3e7a5 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>
2015-03-20 20:09:00 -07:00
Doug Davis
c536e5bfb4 Merge pull request #11397 from ahmetalpbalkan/win-cli/build-warning
Add cli build warning about chmod bits on windows
2015-03-20 19:19:38 -04:00
Ahmet Alp Balkan
4a8b3cad60 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>
2015-03-20 20:13:32 +00:00
Doug Davis
b4beb0637a 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>
2015-03-20 05:55:48 -07:00
Doug Davis
97c573bf02 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>
2015-03-19 19:18:00 -07:00
Brian Goff
e6ae89a45a 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>
2015-03-18 20:57:13 -04:00
Arnaud Porterie
b6ac111abf Merge pull request #9882 from ibuildthecloud/labels
Proposal: One Meta Data to Rule Them All => Labels
2015-03-16 20:20:05 -07:00
Tibor Vass
085054db9d Merge pull request #10591 from duglin/ErrUnknownCmd
Generate an error on unknown Dockerfile instruction
2015-03-16 17:47:28 -04:00