Граф коммитов

173 Коммитов

Автор SHA1 Сообщение Дата
Alexander Morozov a31c14cadc Fix TestBuildWithTabs for go 1.4
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2014-12-21 13:49:45 +02:00
Doug Davis f21f9f856e Allow for relative paths on ADD/COPY
Moved Tianon's PR from: https://github.com/docker/docker/pull/7870
on top of the latest code

Closes: #3936

Signed-off-by: Andrew Page <admwiggin@gmail.com>
Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-12-18 05:13:04 -08:00
Michael Crosby 17cacf3326 Merge pull request #9643 from LK4D4/fix_vet_errors
Fix vet errors
2014-12-16 12:04:15 -08:00
Michael Crosby eea9f0e781 Merge pull request #9610 from duglin/Issue9602
Wrap strings that could look like ints in quotes
2014-12-16 12:02:26 -08:00
Arnaud Porterie a76f7c6ec3 Merge pull request #9122 from dqminh/debug-huge-expose
Expose a large number of ports should not slow down builder
2014-12-16 10:03:31 -08:00
Doug Davis d942c59b69 Wrap strings that could look like ints in quotes
When we use the engine/env object we can run into a situation where
a string is passed in as the value but later on when we json serialize
the name/value pairs, because the string is made up of just numbers
it appears as an integer and not a string - meaning no quotes.  This
can cause parsing issues for clients.

I tried to find all spots where we call env.Set() and the type of the
name being set might end up having a value that could look like an int
(like author). In those cases I switched it to use env.SetJson() instead
because that will wrap it in quotes.

One interesting thing to note about the testcase that I modified is that
the escaped quotes should have been there all along and we were incorrectly
letting it thru. If you look at the metadata stored for that resource you
can see the quotes were escaped and we lost them during the serialization
steps because of the env.Set() stuff.  The use of env is probably not the
best way to do all of this.

Closes: #9602

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-12-15 05:10:49 -08:00
Michael Crosby 4856ec0754 Add test to enforce volume build content
This tests ensures that the content from a dir within a build is carried
over even if VOLUME for that dir is specified in the Dockerfile.  This
test ensures this long standing functionality.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-12-12 11:15:31 -08:00
Alexander Morozov a7ae7fed73 Fix vet errors about formatting directives
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2014-12-12 10:58:56 -08:00
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