Commit graph

315 commits

Author SHA1 Message Date
Arnaud Porterie
af2021955c Add integration test for xz path issue
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>

Conflicts:
	integration-cli/docker_cli_build_test.go
2014-12-11 16:29:15 -05:00
Cristian Staretu
e4ba82d50e Add build tests covering extraction in chroot
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2014-12-11 16:26:52 -05:00
unclejack
a57eee2229 integ-cli: add test for links in volumes
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2014-12-11 16:26:52 -05:00
unclejack
7496cbbccc integ-cli: add build test for absolute symlink
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2014-12-11 16:26:52 -05:00
Tibor Vass
0e71a48d4e Add another symlink breakout test
Signed-off-by: Tibor Vass <teabee89@gmail.com>

Conflicts:
	integration-cli/docker_cli_build_test.go
2014-12-11 16:26:51 -05:00
Arnaud Porterie
cfc24769a2 Fix permissions on ADD/COPY
Fix a regression introduced in PR#9467 when a single file was added or
copied.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2014-12-10 11:09:03 -08:00
Michael Crosby
64ebffe7b6 Merge pull request #9467 from icecrime/9401-restrict_add_chown_scope
Reduce permissions changes scope after ADD/COPY
2014-12-09 10:40:23 -08:00
Arnaud Porterie
f3cedce360 Reduce permissions changes scope after ADD/COPY
Permissions after an ADD or COPY build instructions are now restricted
to the scope of files potentially modified by the operation rather than
the entire impacted tree.

Fixes #9401.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2014-12-04 17:16:22 -08:00
Doug Davis
5c91bb93a7 Make 'docker build' send non-err output to stdout
Right now 'docker build' will send:
   Sending build context to Docker daemon
to stderr, instead of stdout.  This PR fixes that.

I looked in the rest of api/client/commands.go for other cases
that might do this and only one jumped out at me:
  https://github.com/docker/docker/blob/master/api/client/commands.go#L2202
but I think if I changed that to go to stdout then it'll mess people up
who are expecting just the container ID to be printed to the screen and
there is no --quiet type of flag we can check.

Closes #9404

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-12-04 14:06:40 -08:00
Jessica Frazelle
fa753e67ae Remove unnessary abstraction deepEqual
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-12-03 17:52:06 -08:00
Daehyeok Mun
7fbbd515b1 remove deprecated cmd function in integration-cli
Remove deprecated cmd function in integration-cli
and change cmd to dockerCmd in all test files

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2014-11-25 00:32:38 +09:00
Alexander Morozov
0f2de5158f Merge pull request #9261 from unclejack/fix_test_tmp_cleanup
fix cleanup of /tmp in tests
2014-11-21 08:48:04 -08:00
Michael Crosby
58b6f31a7a Merge pull request #8251 from duglin/Issue2333
Add support for ENV of the form: ENV name=value ...
2014-11-20 13:12:24 -08:00
Doug Davis
1314e1586f Add support for ENV of the form: ENV name=value ...
still supports the old form: ENV name value

Also, fixed an issue with the parser where it would ignore lines
at the end of the Dockerfile that ended with \

Closes #2333

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-20 09:54:28 -08:00
unclejack
db7fded17f integ-cli: fix cleanup in build tests
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-11-20 19:38:41 +02:00
Tonis Tiigi
da3d3b97eb Make sure integration-cli test clean up
Common patterns:
- Multiple images were built with same name but only one cleanup.
- Containers were deleted after images.
- Images not removed after retagging.

Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
2014-11-19 23:41:46 +02:00
Daniel, Dao Quang Minh
29be7b439e add test for exposing large number of ports
this test checks if exposing a large number of ports in Dockerfile properly
saves the port in configs. We dont actually expose a VERY large number of ports
here because the result is the same and it increases the test time by a few
seconds

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
2014-11-13 13:08:52 -05:00
Daniel, Dao Quang Minh
1e7ba09b60 add a test case for EXPOSE ports order
changing order of EXPOSE ports should not invalidate the cache as the content
doesnt change

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
2014-11-12 09:14:35 -05:00
Jessie Frazelle
4fcd3dd748 Merge pull request #8716 from duglin/Issue8331
Use the HTTP Last-Modified http header as the mtime value for ADD cmd when present
2014-11-10 13:03:57 -07:00
Doug Davis
2e482c86bc Use the HTTP Last-Modified http header as the mtime value for ADD cmd when present
Closes #8331

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-07 13:58:05 -08:00
Alexandr Morozov
18d9f1978b Fix vet errors
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-11-05 08:26:22 -08:00
Tibor Vass
a85f58719f Merge pull request #8739 from duglin/CleanupDockerIgnores
Do some cleanup on .dockerignore paths
2014-11-03 16:05:24 -05:00
Doug Davis
c0f0f5c988 Do some cleanup on .dockerignore paths
While working on the fix for #8330 I noticed a few things:
1 - the split() call for the .dockerignore process will generate a blank
    "exclude".  While this isn't causing an issue right now, I got worried
	that in the future some code later on might interpret "" as something bad,
	like "everything" or ".".  So I added a check for an empty "exclude"
	and skipped it
2 - if someone puts "foo" in their .dockerignore then we'll skip "foo".
    However, if they put "./foo" then we won't due to the painfully
	simplistic logic of go's filepath.Match algorithm.  To help things
	a little (and to treat ./Dockerfile just like Dockerfile) I added
	code to filepath.Clean() each entry in .dockerignore.  It should
	result in the same semantic path but ensure that no matter how the
	user expresses the path, we'll match it.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-02 11:29:46 -08:00
Erik Hollensbe
24545c18c3 builder: Restore /bin/sh handling in CMD when entrypoint is specified with JSON
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-27 21:50:22 +00:00
Erik Hollensbe
4e74cd498b builder: whitelist verbs useful for environment replacement.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-27 17:38:25 +00:00
Erik Hollensbe
be49867cab builder: handle escapes without swallowing all of them.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-27 17:38:24 +00:00
Erik Hollensbe
cdd6e97910 builder: some small fixups + fix a bug where empty entrypoints would not override inheritance.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-24 00:23:25 +00:00
Erik Hollensbe
a34831f016 builder: handle cases where onbuild is not uppercase.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-21 20:17:37 +00:00
Doug Davis
c980fe09b7 Add a testcase to make sure we don't squash tabs or convert them to spaces
This is in response to @SvenDowideit asking if we had a "tab" testcase
in https://github.com/docker/docker/issues/2315#issuecomment-58133508
I couldn't find one so I'm adding one

Closes #2315

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-10-17 15:52:48 -07:00
Alexandr Morozov
75fd1b614d Merge pull request #8639 from erikh/fix_escapes
builder: fix escaping for ENV variables.
2014-10-17 15:50:37 -07:00
Erik Hollensbe
df0e0c7683 builder: fix escaping for ENV variables.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-17 21:47:35 +00:00
Jessie Frazelle
3c325f89e5 Merge pull request #8415 from LK4D4/use_logs_in_builder
Use logs instead of attach for builder
2014-10-17 13:32:13 -07:00
Alexandr Morozov
6f09d064bd Use logs instead of attach for builder
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-17 13:20:02 -07:00
Alexandr Morozov
98e7608b4c Rewrite TestBuildCopyDisallowRemote to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-17 11:58:12 -07:00
Alexandr Morozov
c8a5d56fd7 Rewrite TestBuildCopyEtcToRoot to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-17 11:57:48 -07:00
Alexandr Morozov
6582ea574c Rewrite TestBuildCopyWholeDirToRoot to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-17 11:57:30 -07:00
Alexandr Morozov
4a029259ff Rewrite TestBuildCopyDirContentToExistDir to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-17 11:57:07 -07:00
Alexandr Morozov
832618afc6 Rewrite TestBuildCopyDirContentToRoot to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-17 11:56:49 -07:00
Alexandr Morozov
24d83afd52 Rewrite TestBuildCopySingleFileToNonExistDir to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-17 11:56:28 -07:00
Alexandr Morozov
2248109ff8 Rewrite TestBuildCopySingleFileToExistDir to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-17 11:56:01 -07:00
Alexandr Morozov
d41cba6aed Rewrite TestBuildCopySingleFileToWorkdir to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-17 11:55:34 -07:00
Alexandr Morozov
83c5dced10 Rewrite TestBuildCopySingleFileToRoot to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-17 11:55:04 -07:00
Alexandr Morozov
e45c92153d Rewrite TestBuildCopyAddMultipleFiles to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-17 11:54:29 -07:00
Jessie Frazelle
5a20dc67b0 Merge pull request #8567 from LK4D4/add_log_done
Add logDone for TestBuildAddSingleFileToNonExistDir
2014-10-17 11:20:12 -07:00
Jessie Frazelle
09ceae5c9c Merge pull request #8486 from duglin/Issue5701
Add failing testcase for single quotes in CMD
2014-10-17 11:11:49 -07:00
Jessica Frazelle
b1e3c9e9cd Cleanup errorOut resp in build tests
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-10-16 15:06:20 -07:00
Doug Davis
9edf967824 Add failing testcase for single quotes in CMD
Closes #5701

This is due to @SvenDowideit comment at: https://github.com/docker/docker/issues/5701#issuecomment-58133541
where he asked for a testcase showing the error case.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-10-16 14:40:55 -07:00
Alexandr Morozov
fcfe80f633 Minor fix of tests names
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-14 11:47:01 -07:00
Alexandr Morozov
fbaa41b5aa Add logDone for TestBuildAddSingleFileToNonExistDir
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-14 11:17:41 -07:00
Tianon Gravi
24189b2c36 Fix builder from being over-aggressive on ${}
`${SOME_VAR%pattern}` was turning into `SOME_VAL%pattern}` which the shell would then balk at.

I've updated the `TOKEN_ENV_INTERPOLATION` regex to account for this (ie, if `${` is used, it _must_ also match the closing `}`), and renamed the variable to not be exported (since it's not used outside the function following it).

I also added comments for the bits of `tokenEnvInterpolation` so they're easier to follow. 😄

Signed-off-by: Andrew Page <admwiggin@gmail.com>
2014-10-14 00:58:55 -06:00