Commit Graph
150 Commits
Author SHA1 Message Date
Guillaume J. Charmes bf1c684667 Fix remote tar ADD behavior
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: 98ce0cdb4f80550462675ee3bbb927451bb76585
Component: engine
2014-02-17 17:08:17 -08:00
Alexander Larsson e12f62e6df Properly close archives
All archive that are created from somewhere generally have to be closed, because
at some point there is a file or a pipe or something that backs them. So, we
make archive.Archive a ReadCloser. However, code consuming archives does not
typically close them so we add an archive.ArchiveReader and use that when we're
only reading.

We then change all the Tar/Archive places to create ReadClosers, and to properly
close them everywhere.

As an added bonus we can use ReadCloserWrapper rather than EofReader in several places,
which is good as EofReader doesn't always work right. For instance, many compression
schemes like gzip knows it is EOF before having read the EOF from the stream, so the
EofCloser never sees an EOF.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: f198ee525ad6862dce3940e08c72e0a092380a7b
Component: engine
2014-02-14 13:46:17 +01:00
unclejack fe6b466dfb Merge pull request #4134 from crosbymichael/fix-add-magic-regression
Fix regression with ADD of tar files
Upstream-commit: 1b8ec8ff1db1ddfd015b7079e39270672692fc70
Component: engine
2014-02-14 03:43:39 +02:00
Michael Crosby 20b4cea323 Fix regression with ADD of tar files
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: cad7f7ee5002206511daee4a29f399e6665f5fab
Component: engine
2014-02-13 17:18:38 -08:00
Victor Vieux 83b45e3c01 Merge pull request #4103 from vieux/add_error_build-rm
add error to docker build --rm
Upstream-commit: 6f10f33387becb3a8470f9f65706d0df919b7e9b
Component: engine
2014-02-13 10:35:55 -08:00
Victor Vieux 1e41d2ac04 add error to docekr build --rm
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: a895c7238d3f32b22989c409a5a3b09aa3463054
Component: engine
2014-02-12 23:23:42 +00:00
Alexander Larsson 22e2031a29 Avoid extra mount/unmount during build
CmdRun() calls first run() and then wait() to wait for it to exit,
then it runs commit(). The run command will mount the container and
the container exiting will unmount it. Then the commit will
immediately mount it again to do a diff.

This seems minor, but this is actually problematic, as the Get/Put
pair will create a spurious mount/unmount cycle that is not needed and
slows things down. Additionally it will create a supurious
devicemapper activate/deactivate cycle that causes races with udev as
seen in https://github.com/dotcloud/docker/issues/4036.

To ensure that we only unmount once we split up run() into create()
and run() and reference the mount until after the commit().

With this change docker build on devicemapper is now race-free, and
slightly faster.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 59347fa66dfdd059c270a5f72e24320b4d0203ea
Component: engine
2014-02-12 16:02:53 +01:00
Solomon Hykes e378922981 Move the canonical run configuration objects to a sub-package
* Config is now runconfig.Config
    * HostConfig is now runconfig.HostConfig
    * MergeConfig is now runconfig.Merge
    * CompareConfig is now runconfig.Compare
    * ParseRun is now runconfig.Parse
    * ContainerConfigFromJob is now runconfig.ContainerConfigFromJob
    * ContainerHostConfigFromJob is now runconfig.ContainerHostConfigFromJob

This facilitates refactoring commands.go and shrinks the core.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 6393c38339e11b4a099a460ecf46bb5cafc4283b
Component: engine
2014-02-11 20:18:46 -08:00
Solomon Hykes 3b6d4254e4 builder: clearly display ONBUILD triggers during a build.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: ded9e0d6dfbcfe0f2ccd448baf0acb4378365bac
Component: engine
2014-02-04 19:11:56 +00:00
Solomon Hykes eaeb410e5e New build instruction: ONBUILD defines a trigger to execute when extending an image with a new build
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 9f994c96468e2495a2dc118355b6565e7dac0f44
Component: engine
2014-02-04 01:31:19 +00:00
Solomon Hykes 06516f2793 Builder: extract the execution of a single build step into buildFile.BuildStep
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: a51f5a287b7b393b23e27787f090575b30cbb68a
Component: engine
2014-02-04 01:23:01 +00:00
Alexander Larsson 6d81dd5d9b Separate out graphdriver mount and container root
This separates out the directory as returned from the graphdriver (the
"base" fs) from the root filesystem of the live container. This is
necessary as the "diff" operation needs access to the base filesystem
without all the mounts that the running container needs (/.dockerinit,
volumes, etc).

We change container in the following way:

Container.RootfsPath() returns the the directory which will be used as
the root in a running container. It is always of the form
"/var/lib/docker/container/<id>/root" and is a private bind mount to
the base filesystem. It is only available while the container is running.

Container.BasefsPath() returns the raw directory from the graph driver
without the container runtime mounts. It is availible whenever the
container is mounted (in between a container.Mount()/Unmount() pair,
which are properly refcounted).

This fixes issue #3840

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: fab19d197c6cc362182f6cee4d0a6e65e799875f
Component: engine
2014-01-30 16:43:53 +01:00
Victor Vieux 10c689f549 move pull and import to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: 9dcbdbc4b1addb67c0fdcadab1c8f98f30e58b4c
Component: engine
2014-01-24 14:46:31 -08:00
Michael Crosby 31fb352a08 Merge pull request #3558 from tianon/buildfile-run-json
Add support for RUN [""] in Dockerfiles
Upstream-commit: 2a6e93a6fb9870cd2c2e1942afcdea5f154f1715
Component: engine
2014-01-22 11:51:34 -08:00
Alexander Larsson 36def61b75 Remove container.EnsureMounted
This was deprecated already and all it did was call Mount().
The use of this was a bit confusing since we need to pair Mount/Unmount
calls which wasn't obvious with "EnsureMounted".

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 191aa17d16c0935a7deda03b4c3bc879f7a316eb
Component: engine
2014-01-21 11:26:11 +01:00
Jake Moshenkoandyackob03 145ef0e1f4 Fix support for registry auth with Dockerfile build.
Docker-DCO-1.1-Signed-off-by: Jake Moshenko <jake@devtable.com> (github: jakedt)
Upstream-commit: 6e6ff85362dfa823c392392cb9e70d620e308911
Component: engine
2014-01-20 18:35:14 -05:00
Gereon Frey 0aa4f1bddd detect compressed archives in API /build call
AFAIK in some previous version it was possible to give a compressed docker file
to the API's build command and that was handled properly (aka compression was
detected and archive uncompressed accordingly). Fails with at least 0.7.5.

Fixed this using the DecompressStream method from the archive package.

Docker-DCO-1.1-Signed-off-by: Gereon Frey <me@gereonfrey.de> (github: gfrey)
Upstream-commit: 4f53722dee6c8ea18a9c30bde2cc6fee24b03d32
Component: engine
2014-01-17 12:21:26 +01:00
Tianon Gravi c10cddede6 Fix "foo: no such file or directory" test failure, and normalize creation of custom error to always depend on if os.IsNotExist(err) so we don't hide other errors that might crop up in these tests
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: 7a6255efbcb83458ca179b2148fda7a0160a4bd7
Component: engine
2014-01-14 11:42:03 -07:00
Tianon Gravi 3dc8c2a33a Stop ADD from following symlinks outside the context when passed as the first argument
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: fb63cfa9a502e2410597422f8877cf16b0bbaad2
Component: engine
2014-01-11 05:46:11 -07:00
Tianon Gravi f19f8cb54e Add support for RUN [""] in Dockerfiles for greater specificity in what is actually executed
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: fd78128870b78c282b65976cfff100c4101569b1
Component: engine
2014-01-11 04:00:52 -07:00
Guillaume J. Charmes a678ed131c Make sure the remote ADD are cached properly
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: 0fd9c98de3fc2c8fb1da6dc3ef277b3325106b26
Component: engine
2014-01-08 14:22:49 -08:00
Guillaume J. Charmes 4ac9027377 Make sure file are cached correctly during build
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: e24e9c09f8533b662d1d829123431540bb95ea51
Component: engine
2014-01-08 14:22:49 -08:00
Frank MacreeryandGuillaume J. Charmes ffd759db06 Potential fix for ADD .
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: 93ff70a3e70e14762314f04e2b9f61c8710d5353
Component: engine
2014-01-08 14:22:24 -08:00
Guillaume J. Charmes 7e278d9841 Disable compression for build. More space usage but much faster upload
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: c6350bcc2411dfc5039976239e143f6b9da64444
Component: engine
2014-01-08 14:21:13 -08:00
Guillaume J. Charmes b0481e14ce Fix issue with file caching + prevent wrong cache hit
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: f3103e5c9157aed2a5ab0f4c70e328cd0aa69b59
Component: engine
2014-01-07 16:53:55 -08:00
Guillaume J. CharmesandGuillaume J. Charmes 45fc411688 Fix ADD caching issue with . prefixed path
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <charmes.guillaume@gmail.com> (github: creack)
Upstream-commit: 811341423bd9d3d65640cb4aa04d2840817182ca
Component: engine
2014-01-07 16:02:20 -08:00
Michael Crosby cc98eeb0c8 Merge pull request #3297 from jaseg/master
Return meaningful error for meaningless Dockerfiles
Upstream-commit: ee6823d797e527a18291561aa84cfd6346dd3893
Component: engine
2014-01-06 10:58:24 -08:00
Victor Vieux 1c8add2753 Merge pull request #3367 from cpuguy83/3362-unify_cmd_entrypoint_handling
Use same error handling while unmarshalling args for CMD and ENTRYPOINT
Upstream-commit: e5b09523dcfabcd252113a8ebda5391c88e777e5
Component: engine
2014-01-06 10:29:37 -08:00
Brian Goff 81433035f2 Use same error handling while unmarshalling args for CMD and ENTRYPOINT
Upstream-commit: 323c4b5211ecef4cffcbe0a97811ddd93c469164
Component: engine
2014-01-06 13:15:14 -05:00
Guillaume J. Charmes 5791b4e848 Hash the sums for directory (ureadable when there is too many
Upstream-commit: cd735496da6d977748d5c3b19976f42d2cc1933e
Component: engine
2013-12-26 16:42:05 -08:00
Guillaume J. Charmes e485023364 Change BuildFile in order to use TarSum instead of custom checksum
Upstream-commit: 894d4a23fba1a67087ae5bbe9c50c56e6dc09289
Component: engine
2013-12-26 16:16:26 -08:00
Guillaume J. Charmes e297baa1c0 Merge pull request #2809 from graydon/880-cache-ADD-commands-in-dockerfiles
Issue #880 - cache ADD commands in dockerfiles
Upstream-commit: efaf2cac5c8d54a5098f7036e738e1f919f84452
Component: engine
2013-12-24 16:22:51 -08:00
jaseg 7529ef336e Return meaningful error for meaningless Dockerfiles
Upstream-commit: b8cd2bc94d58e9ca1c6f9a41979b857cfa4b698f
Component: engine
2013-12-20 16:19:21 +01:00
Johannes 'fish' Ziemke 0b51803275 Return error if Dockerfile is empty
Upstream-commit: f7ba1c34bb7670b1a8d761b73eb9a775fa0f6bbe
Component: engine
2013-12-20 14:13:52 +01:00
Graydon HoareandGraydon Hoare 981ec0641d Record added-tree sha256 in buildfile.CmdAdd, probe and use cache.
Upstream-commit: 3f9416b58da029b7d82a4908f6c066cee0695edf
Component: engine
2013-12-16 17:36:51 -08:00
Graydon HoareandGraydon Hoare 7ca46955f3 Factor cache-probing logic out of buildfile.commit() and CmdRun().
Upstream-commit: 7afd7a82bd672bf7b3976458197b8c56c17407de
Component: engine
2013-12-16 17:36:50 -08:00
Guillaume J. Charmes e18bf01fe0 Merge pull request #3099 from vieux/fix_pull_build
added authConfig to docker build
Upstream-commit: b3ad3307829dc4601cb996be3d6d8cfa37e71c79
Component: engine
2013-12-16 10:53:10 -08:00
Victor Vieux e34a28d653 added authConfig to docker build
Upstream-commit: 228091c79ed043d1896afb04cd0573ee972c2607
Component: engine
2013-12-06 14:27:10 -08:00
Victor Vieux d92518e8b2 fix jsonmessage in build
Upstream-commit: 05f416d869777aa613a5a197ad287c18b77366d3
Component: engine
2013-12-06 14:09:27 -08:00
Victor Vieux 8eac8d89db remove unused parameter in Download
Upstream-commit: 12180948be8040a4cdf99a0e660098cd33e32832
Component: engine
2013-12-04 11:54:11 -08:00
Guillaume J. Charmes 3412149ffe Do not format at each write but use a Writer instead (build)
Upstream-commit: de4429f70d51056c3ec32072f3f18898e36171b3
Component: engine
2013-12-02 11:43:41 -08:00
Michael Crosby 26b3fb6752 Merge pull request #2829 from dotcloud/refactor_opts
Refactor opts
Upstream-commit: fe571dd29328efe5f5318c0b146d0aa5a66217a2
Component: engine
2013-12-02 10:41:30 -08:00
Johannes 'fish' Ziemke 85e4b81e0c Make docker build return exit code of build step
If a command during build fails, `docker build` now returns with
the exit code of that command.

This makes it necessary to change the build api endpoint to
return a json object stream.
Upstream-commit: b04c6466cdc89a107879af7a22b0917006b38730
Component: engine
2013-12-02 17:52:37 +01:00
Victor Vieux 34e8bb0db2 Merge pull request #2692 from SvenDowideit/add-specific-feedback-for-bad-ADD
Add specific feedback for ADD outside context
Upstream-commit: 926f7b579e48dcd5bda26bcd7a0ef0e25aed94da
Component: engine
2013-11-28 17:55:11 -08:00
Guillaume J. Charmes f211a9a21d Refactor Opts
Upstream-commit: 1ba11384bf82f824b0efbab31aaca439cfba1b4f
Component: engine
2013-11-26 17:46:06 +00:00
Solomon Hykes 542c84c74e Merge branch 'master' into 0.6.5-dm-plugin
Upstream-commit: 43c7df946d56a9d9d0e0b7226042a0dd6a58a17b
Component: engine
2013-11-26 02:00:25 +00:00
Sven DowideitandSven Dowideit 2f447b8d32 add more searchable info to the error message when ADD tries to go outside the context
Upstream-commit: 96b5be9dd9606a9bfbf0fdbe98bcaf8b6e77e4b1
Component: engine
2013-11-23 12:23:31 +10:00
Guillaume J. Charmes 63cc3164f1 Remove useless New*Opt functions, singleline Opt types
Upstream-commit: c67f9b671df024d06b0af0a0eaa02058e69ee9f5
Component: engine
2013-11-22 14:42:30 -08:00
Michael Crosby 084cb15f1a Allow drivers to implement ApplyDiff in Differ interface
Upstream-commit: 5d9723002bc764e2c768e5184994d7949f55fc49
Component: engine
2013-11-11 19:09:57 -08:00
Michael Crosby 33ea8b01c4 Use parent image config in buildfile
Upstream-commit: 99141ea3ca3c0429ecdfc3bdb097a68957beab71
Component: engine
2013-11-04 13:20:14 -08:00