Commit Graph

610 Commits

Author SHA1 Message Date
98bb6eba72 Make FROM scratch a special cased 'no-base' spec
There has been a lot of discussion (issues 4242 and 5262) about making
`FROM scratch` either a special case or making `FROM` optional, implying
starting from an empty file system.

This patch makes the build command `FROM scratch` special cased from now on
and if used does not pull/set the the initial layer of the build to the ancient
image ID (511136ea..) but instead marks the build as having no base image. The
next command in the dockerfile will create an image with a parent image ID of "".
This means every image ever can now use one fewer layer!

This also makes the image name `scratch` a reserved name by the TagStore. You
will not be able to tag an image with this name from now on. If any users
currently have an image tagged as `scratch`, they will still be able to use that
image, but will not be able to tag a new image with that name.

Goodbye '511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158',
it was nice knowing you.

Fixes #4242

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 8936789919c5c8004f346f44a3452d1521818b60
Component: engine
2014-12-18 14:03:38 -08:00
4af408b6c1 Merge pull request #9635 from duglin/Issue3936
Allow for relative paths on ADD/COPY
Upstream-commit: 364720b5e7e725cdc466171de873eefdb8609a33
Component: engine
2014-12-18 06:58:50 -08:00
a9b8d39261 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>
Upstream-commit: f21f9f856e9d5af23521f131799028c2e67c04ed
Component: engine
2014-12-18 05:13:04 -08:00
0935b51529 Merge pull request #9181 from icecrime/allocate_daemon_ports
Allocate daemon listening ports
Upstream-commit: 21bba5d93a888e20d7fa8d7dd56efbdd1fd486c1
Component: engine
2014-12-17 18:01:20 -08:00
6b6aa4bf22 Merge pull request #9643 from LK4D4/fix_vet_errors
Fix vet errors
Upstream-commit: 17cacf3326edde6d177e12132f74fc0174bda1d2
Component: engine
2014-12-16 12:04:15 -08:00
55ec358b5c Merge pull request #9610 from duglin/Issue9602
Wrap strings that could look like ints in quotes
Upstream-commit: eea9f0e781f5a2cc438aad11315253b6fb42ed9e
Component: engine
2014-12-16 12:02:26 -08:00
2187cf5beb Merge pull request #9122 from dqminh/debug-huge-expose
Expose a large number of ports should not slow down builder
Upstream-commit: a76f7c6ec32431b6cbf286d9be86f7dde0b3ac0d
Component: engine
2014-12-16 10:03:31 -08:00
2fa048715a Merge pull request #9631 from cpuguy83/9628_fix_volumes_hostconfig_on_start
Fix volumes-from/bind-mounts passed in on start
Upstream-commit: 24d03b8ddee1d4b19d3ab34f66e4c54dda8b129e
Component: engine
2014-12-15 15:51:57 -08:00
8ef74b2a51 Merge pull request #9638 from crosbymichael/build-volumes-retain-contents
Add test to enforce volume build content
Upstream-commit: b84bfb43cdf94045a705989c7b1a4fb47f7ed84a
Component: engine
2014-12-15 14:54:38 -08:00
ecd4852381 Fix volumes-from/bind-mounts passed in on start
Fixes #9628
Slightly reverts #8683, HostConfig on start is _not_ deprecated.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d44c9f91472eb3df4c38c669134df04b2ccf9953
Component: engine
2014-12-15 16:51:15 -05:00
d89ea8b641 Fix missing logDone for TestRunMutableNetworkFiles
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 03bdacbb4e4bf2fabf67bfdb8b5118bc7ed1edd2
Component: engine
2014-12-15 13:44:22 -08:00
ba3cc4bafb 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>
Upstream-commit: d942c59b696d16def85f6b65ae65c176f66a5562
Component: engine
2014-12-15 05:10:49 -08:00
50ca4df488 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>
Upstream-commit: 4856ec075422a7926b62762749a7fbcc869efa99
Component: engine
2014-12-12 11:15:31 -08:00
bebcb13002 Fix vet errors about formatting directives
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a7ae7fed7311551975d2bccb7417c328be3ea478
Component: engine
2014-12-12 10:58:56 -08:00
98f4a5ba65 Merge pull request #9606 from LK4D4/fix_race_in_test
Fix race in TestDaemonRestartWithVolumesRefs
Upstream-commit: c60e60a184cd8b07ea29f073585cb214408cdd7e
Component: engine
2014-12-11 18:27:38 -08:00
88fcffd088 Merge pull request #9624 from icecrime/silence_loginwithouttty_test
Suppress output of TestLoginWithoutTTY
Upstream-commit: a07835d876b8c8f1991868cc6f1c9b3e2726eaec
Component: engine
2014-12-11 18:26:58 -08:00
6a7248c5b7 Suppress output of TestLoginWithoutTTY
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 1cab340c10be71382a8cfde8402f475d503c94be
Component: engine
2014-12-11 18:05:07 -08:00
67b329feba Add integration test for xz path issue
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>

Conflicts:
	integration-cli/docker_cli_build_test.go
Upstream-commit: af2021955cb01507984cbd076edaf3caaf5b89b3
Component: engine
2014-12-11 16:29:15 -05:00
a013d9f804 Add build tests covering extraction in chroot
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: e4ba82d50ee4642412a1e1bdf43a7b94fadd2428
Component: engine
2014-12-11 16:26:52 -05:00
273d3a2f40 integ-cli: add test for links in volumes
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: a57eee2229c2f0c53c32372587fcc2a8327044ea
Component: engine
2014-12-11 16:26:52 -05:00
e6c672e7d3 integ-cli: add build test for absolute symlink
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: 7496cbbccc278c084620661812ed5f6390c1d2f1
Component: engine
2014-12-11 16:26:52 -05:00
dedefc8fcd Add another symlink breakout test
Signed-off-by: Tibor Vass <teabee89@gmail.com>

Conflicts:
	integration-cli/docker_cli_build_test.go
Upstream-commit: 0e71a48d4e89ce40c0ab94cc18599481d9e8a6b0
Component: engine
2014-12-11 16:26:51 -05:00
41b0254a74 Fix race in TestDaemonRestartWithVolumesRefs
Sometimes rm begins before process death, but Kill called already after
it, so we get error - no such process.

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 0d70ad1c7205ba9e82dd1f244d26df93dc79de9e
Component: engine
2014-12-10 20:55:51 -08:00
5231d38261 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>
Upstream-commit: cfc24769a26e825e4267cbfdd59af807e27508b9
Component: engine
2014-12-10 11:09:03 -08:00
1d39a69298 Forbid client piping to tty enabled container
Forbid `docker run -t` with a redirected stdin (such as `echo test |
docker run -ti busybox cat`). Forbid `docker exec -t` with a redirected
stdin. Forbid `docker attach` with a redirect stdin toward a tty enabled
container.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 67e3ddb75ff27b8de0022e330413b4308ec5b010
Component: engine
2014-12-09 14:30:49 -08:00
b4787aa54e Add test for exec tty stdin close
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 243a640d3e593ee11e31ac55a4df8c887c2b09c9
Component: engine
2014-12-09 14:30:49 -08:00
bb5a33c82a Merge pull request #9356 from cc272309126/fix-exec-paused-container
Fix the issue that when docker exec a paused container, it will always
Upstream-commit: bb24f99d741cd8d6a8b882afc929c15c633c39cb
Component: engine
2014-12-09 11:01:44 -08:00
9923dcade2 Merge pull request #9467 from icecrime/9401-restrict_add_chown_scope
Reduce permissions changes scope after ADD/COPY
Upstream-commit: 64ebffe7b6e4a6732b3b6f56585bc8d01f4f8ed0
Component: engine
2014-12-09 10:40:23 -08:00
3890e00172 Running a container that links to a container with --net host
should throw an error.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 6743be44ca9006cb7ca26cd3d8410877727a6313
Component: engine
2014-12-08 11:33:18 -08:00
15957abc33 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>
Upstream-commit: f3cedce3608afe7bd570666a7fc878ab85c7bc03
Component: engine
2014-12-04 17:16:22 -08:00
52bfe6086a 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>
Upstream-commit: 5c91bb93a7e35b2d443090cabc7ec0a2ca59b6ee
Component: engine
2014-12-04 14:06:40 -08:00
2b487e0de2 Fix the issue when docker exec a paused container, it will always hang.
Add the test case of this issue.

Docker-DCO-1.1-Signed-off-by: Chen Chao <cc272309126@gmail.com> (github: cc272309126)
Upstream-commit: 1bb02117db80e75f406f6c63d8d50680c1569019
Component: engine
2014-12-05 03:10:44 +08:00
61a90c5a2b Run 'go vet' on integration-cli.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 4ee3a318a1f43f35a8c6ec8b6b73db5ea8824de9
Component: engine
2014-12-03 18:45:51 -08:00
9442c6a19e Remove unnessary abstraction deepEqual
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: fa753e67ae2bf573c9dfb1da1e1135c5ef5ef415
Component: engine
2014-12-03 17:52:06 -08:00
2a07b18ca1 Remove unnecessary abstraction nLines
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 02a021119fb2b3e051b98817831a8c1a8a9fd464
Component: engine
2014-12-03 17:47:28 -08:00
4cd694cddb cleanup: remove startCommand function, only used once, and
unecessary abstraction.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 7ba9a18ade7393d942d995d34a92d757ef4af0b7
Component: engine
2014-12-03 17:43:26 -08:00
b108f27ddc Fix tests with old cmd function.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: e201d5bcd46a3dcb70dd6b6e23ee375e4b5b5f40
Component: engine
2014-12-03 15:53:19 -08:00
e1ce0e0de9 Merge pull request #9089 from cpuguy83/8942_create_volumes_on_create
Initialize volumes when container is created
Upstream-commit: 67fda331973fdd23f3da79588ea899dc577f46e8
Component: engine
2014-12-03 15:42:09 -08:00
fdf7191cae Merge pull request #9435 from cpuguy83/9414_fix_exec_api_error_no_cmd
Check for no `Cmd` on exec create endpoint
Upstream-commit: 50445e4d0c622837f1dd9bd5b3810d3b309b7d18
Component: engine
2014-12-02 10:28:44 -08:00
9254581bd3 Try other port on any error from Map
Sometimes other programs can bind on ports from our range, so we just
skip this ports on allocation.

Fixes #9293
Probably fixes #8714

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a00a1a1fca020d21cb677439160e018bda5c3835
Component: engine
2014-12-01 16:26:30 -08:00
67d69faf00 Check for no Cmd on exec create endpoint
Fixes #9414

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c8a3d31332074ddc226086ff1f0c042b6e120232
Component: engine
2014-12-01 17:54:15 -05:00
539a7bfbcc Merge pull request #9378 from LK4D4/change_breakout_detection
Change symlink breakout detection logic in archive package
Upstream-commit: 8ddb42fbfd692a9888c1e8e9ebacefed62e123ef
Component: engine
2014-12-01 19:23:18 +02:00
154f28d3d7 Fixes race condition in test. Closes #9389.
Signed-off-by: Emily Maier <emily@emilymaier.net>
Upstream-commit: 9c5e61c24c490ca3e9d52855ee26d4a8e9032fb2
Component: engine
2014-11-28 13:48:50 -05:00
b86ab101dc Change path breakout detection logic in archive package
Fixes #9375

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: be5bfbe2217905ba129588fe17264b96c866e26d
Component: engine
2014-11-28 09:44:47 -08:00
cd036c2490 Increase memory limit in test cases
Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>
Upstream-commit: 64fd3e89c7f6164b5522b5e611e7daf4a2bdae9c
Component: engine
2014-11-27 03:22:16 +09:00
484c26692a fix where cmd function dne
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 8635b0248a1166a48dbd0fbe32df7b19f4ccea62
Component: engine
2014-11-25 18:34:08 -08:00
3253386751 Merge pull request #9208 from duglin/Issue8703
Add support for docker exec to return cmd exitStatus
Upstream-commit: 00c2a8f323548b7d0aa54cfd10a594dd93ddbed0
Component: engine
2014-11-25 18:03:51 -08:00
039ddfff8b Merge pull request #8893 from vieux/filter_events
Events filtering (daemon side)
Upstream-commit: 9160e01cefbc4a7dd2ad38167c928c959dde3fad
Component: engine
2014-11-25 17:52:27 -08:00
c28ef478d3 Add support for docker exec to return cmd exitStatus
Note - only support the non-detached mode of exec right now.
Another PR will add -d support.

Closes #8703

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 90928eb1140fc0394e2a79d5e9a91dbc0f02484c
Component: engine
2014-11-25 17:49:25 -08:00
2d3f0f7b70 Test for updating hosts files via links.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 68bc8de111e4faa2a16583cd45b5c0fd253a3bba
Component: engine
2014-11-25 16:48:36 -08:00