Commit Graph

49 Commits

Author SHA1 Message Date
1c502571ef add defer file.Close to avoid potential fd leak
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 0ead624473b6bddc232b46bc7c76ab4f9c743ff5
Component: engine
2016-08-10 08:36:09 +08:00
a3be33ddb5 Say something useful during docker load
During a `docker load` there are times when nothing is printed
to the screen, leaving the user with no idea whether something happened.
When something *is* printed, often its just something like:
```
1834950e52ce: Loading layer 1.311 MB/1.311 MB
5f70bf18a086: Loading layer 1.024 kB/1.024 kB
```
which isn't necessarily the same as the image IDs.

This PR will either show:
- all of the tags for the image, or
- all of the image IDs if there are no tags

Sample output:
```
$ docker load -i busybox.tar
Loaded image: busybox:latest

$ docker load -i a.tar
Loaded image ID: sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb
```

IOW, show the human-friendly stuff first and then only if there are no tags
default back to the image IDs, so they have something to work with.

For me this this is needed because I have lots of images and after a
recent `docker load` I had no idea what image I just imported and had a
hard time figuring it out.  This should fix that by telling the user
which images they just imported.

I'll add tests once there's agreement that we want this change.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 6986a3220fe59146eeddeaa865561472abc7baeb
Component: engine
2016-06-08 17:17:05 +02:00
7db547d6f1 Fix flaky TestSaveLoadParents
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 0c0198a5e671928b67db6a3be35f1a419f633af4
Component: engine
2016-04-06 21:58:47 -07:00
d833f49cea Add parent references support to load/save
Restores the correct parent chain relationship
between images on docker load if multiple images
have been saved.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: faeff5118f710f7c4f6173c309b52aaba24118c9
Component: engine
2016-03-21 19:31:10 -07:00
5ab9ec7f3a Refine error message when save non-exist image
Fixes: #20709
As discussed in the issue, we need refine the message to
help user more understood, what happened for non-exist image.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
Upstream-commit: ed231d409501d1e496fbe2b2e31a279eb2998cf2
Component: engine
2016-03-08 01:45:19 +00:00
8bc92ae008 Assert error in body of function inspectField*
1. Replace raw `docker inspect -f xxx` with `inspectField`, to make code
cleaner and more consistent
2. assert the error in function `inspectField*` so we don't need to
assert the return value of it every time, this will make inspect easier.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 62a856e9129c9d5cf7db9ea6322c9073d68e3ea4
Component: engine
2016-01-29 23:39:07 +08:00
8157f678e4 Windows CI: Deal with failing tests for TP4
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 25c383391a951e5bc9cb2f003ce69f119779fb2c
Component: engine
2016-01-08 13:49:43 -08:00
a047f4a27c Fix for zero-sized layers
Moved a defer up to a better spot.

Fixed TestUntarPathWithInvalidDest to actually fail for the right reason

Closes #18170

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 7bb9fc415ac50abf5f754005264bfe152eeca7d6
Component: engine
2015-11-25 18:02:03 -08:00
e105a29374 Update daemon and docker core to use new content addressable storage
Add distribution package for managing pulls and pushes. This is based on
the old code in the graph package, with major changes to work with the
new image/layer model.

Add v1 migration code.

Update registry, api/*, and daemon packages to use the reference
package's types where applicable.

Update daemon package to use image/layer/tag stores instead of the graph
package

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 4352da7803d182a6013a5238ce20a7c749db979a
Component: engine
2015-11-24 09:40:25 -08:00
cf05bcf15c Build and test Docker on IBM Power and Z using gccgo. Enable CI on Power and Z.
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: b1cc78b8f5d0c85c80c04a15fa791025ae7d22e6
Component: engine
2015-11-14 03:16:45 +00:00
bdc1bdd264 update test using c.Assert replace c.Fatal
Signed-off-by: Hao Zhang <21521210@zju.edu.cn>
Upstream-commit: d5830d66e0fab58ef5543dd5b0e157b84017c3a4
Component: engine
2015-10-12 06:32:21 -04:00
fe5747bb6d Merge pull request #15693 from vdemeester/15659-image-label-filter
Fix #15659 : filter by label for docker images commited
Upstream-commit: 41c99cc62161376981d1c24f30c0e340124778e8
Component: engine
2015-10-08 11:14:51 -07:00
b8616b16f4 Merge pull request #16076 from vbatts/export_image_times
graph: exported images times matching creation
Upstream-commit: 77da5d8feb5cf88446df0045240b4943ce4fc206
Component: engine
2015-10-01 21:50:43 +01:00
90b9ae3169 save: integration test for timestamp matching
The `docker save`ed output ought to have matching timestamp to the layer
creation.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: e4478caddf78700bd42f94eb382ae1805a443618
Component: engine
2015-10-01 14:38:55 -04:00
c03ccb6893 Windows: Get Integration CLI running
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f9a3558a9d75ed6a2f9f1b2d80800226afaa74a5
Component: engine
2015-09-04 12:32:40 -07:00
ae7a8a8203 Fix filter by label for docker images
Using Config.Labels to filter images on Labels.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c71a99af11c1ae5442b7787368fd27ac2799ef99
Component: engine
2015-08-22 14:06:48 +02:00
6e14356132 Don't pass check.C to dockerCmdWithError
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 693ba98cb9118bf15caaabc69ca281c0ce604226
Component: engine
2015-07-27 14:33:32 -04:00
6aa4de764e Fix golint warnings for integration-cli
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Upstream-commit: 6b3c928140193f911b73f87bb8b07f54bba5a63a
Component: engine
2015-07-22 14:03:50 +01:00
018c7593fb CI: use dockerCmd in integration-cli when possible
Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: 012b67c3ea5bff539673deaa7058036126ac1046
Component: engine
2015-07-22 17:55:41 +08:00
f4541a8bb5 Cleanup not needed calls to deleteImages
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: d3566fa0b1130fb938ad55da69fee2b7790dc3cf
Component: engine
2015-07-13 20:30:53 +02:00
2a80100987 Clean tests from not needed inspect call
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: a268e36719e38b91a4ece84e3fdb742ed36feac3
Component: engine
2015-05-16 18:12:54 +02:00
ae74d9f34f trivial: typo cleanup
Signed-off-by: David Mackey <tdmackey@booleanhaiku.com>
Upstream-commit: 3941623fbc3fa724d61f53121513ffd87d03b61c
Component: engine
2015-04-27 13:35:08 -07:00
c48fdf0abd Implement teardown removeAllImages
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a9688cdca5577d6db65d76f38bcbe4c1e6f5994f
Component: engine
2015-04-24 10:37:21 -07:00
1fa837ad6f delete "defer deleteContainer" on tests
Since docker test suite is now using gocheck, ``defer
deleteContainer(…)`` is not needed anymore.

Fixes #12705

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c5ef2901d8190b687e847ab17d306dae5af37b42
Component: engine
2015-04-23 22:27:46 +02:00
1884ef3b9b 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>
Upstream-commit: dc944ea7e48d11a2906e751d3e61daf08faee054
Component: engine
2015-04-21 10:28:52 -07:00
ab9a366f0e Remove stripTrailingCharacters from tests
This was just an alias to `strings.TrimSpace`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 475c65319b4663d630711519e18d0b134c42c7f1
Component: engine
2015-04-06 09:21:18 -04:00
205614d416 Reinit slice for each dir in search
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 8be8e41429a3af59df35a6b0281eefd2bb34e1b5
Component: engine
2015-02-25 15:53:07 -08:00
56a989cee4 Merge pull request #10510 from ashahab-altiscale/9875-lxc-image-layer
Added /dev paths to layer comparison
Upstream-commit: 481e75203d8c5db264a795c35d422d081a2f03b0
Component: engine
2015-02-25 14:52:31 -08:00
b3b00f07f4 integ-cli: remove bash dependency from TestSaveDirectoryPermissions
Use the new `runCommandPipelineWithOutput` helper to
remove bash dependency required for piping in
`TestSaveDirectoryPermissions`.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: c3e28351a1547f4999aafb0780e4b1a5d84d78ac
Component: engine
2015-02-24 15:52:06 -08:00
6e1d109cda integration-cli: use pipes for save/load tests
This removes `bash` dependency from save/load integration tests.
It used to call `/bin/bash -c 'c:\...\docker.exe'` which is not valid.
Also removed usage of tempdirs and temp files for saving/loading
repos. All are now done using in-memory pipes and buffers.

Created `runCommandPipelineWithOutput` helper to replace the
`/bin/bash -c 'a | b | c'` using pipes and returning output from
last command in the pipeline. This makes the code even shorter
and readable.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: b81105eaca56e7b22c97e24b7314419ee0a4f2a9
Component: engine
2015-02-17 17:09:09 -08:00
ba0c809ee8 Added /dev paths to layer comparison
Lxc images have /dev (devices). This creates a list with the /dev paths in the test.
Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
Upstream-commit: ea0fd0e8e5ba5cccdf5bf0e475a165c4996bd9aa
Component: engine
2015-02-05 20:36:30 +00:00
e61e114873 Enable test-integration-cli for Windows platform
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: f3ed42286e7df3a35ca41a4d19fab2a53a08b382
Component: engine
2014-12-20 16:40:40 -08:00
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
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
6951abbd89 Merge pull request #9009 from a-ba/fix-export-repo
fix missing layers when exporting a full repository 
Upstream-commit: a5277764aed9e5493387a6f4caf2bb93a0a6afa3
Component: engine
2014-11-21 15:44:27 -05:00
865600707c 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)
Upstream-commit: da3d3b97ebe1e6fe1254367521c725ca12a5e61d
Component: engine
2014-11-19 23:41:46 +02:00
3a9fe771ef fix missing layers when exporting a full repository
Therer is a bug in the 'skip' decision when exporting a repository
(`docker save repo`)

Only the layers of the first image are included in the archive (the
layers of the next images are missing)

Signed-off-by: Anthony Baire <Anthony.Baire@irisa.fr>
Upstream-commit: b37fdc5dd1db196209ebb860c88a37d67bb2cf98
Component: engine
2014-11-14 14:41:35 +01:00
0bfbaf6019 Cleanup some integration-cli output
I noticed a few things that were bugging me in the output
of the integration-cli tests.
- one of the tests used println to stdout so we had garage sent to the screen
- some of the test, in their final log message, didn't include the name of
  the group/file e.g.  daemon - run,iptables   was just   run,iptables

And yes, I noticed this because I'm anal :-)  but also because we should keep
the output of the tests as clean as possible so its easy to spot it when
things go bad.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 0cef21cfba5b06ce7bd5d6b68865a9df0aca95fc
Component: engine
2014-11-11 08:44:32 -08:00
9609160b54 Merge pull request #8321 from erikh/ui_save_output
docker save: Do not save to a terminal.
Upstream-commit: 350e1b783d4deafbb62ede4d17df37dbaffa373a
Component: engine
2014-10-24 19:37:14 -04:00
c9b622420d Cleanup errorOut resp in save tests
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 0c87424007aa1220842acca26cbadc7c1a05bef9
Component: engine
2014-10-16 15:06:20 -07:00
d3204cb029 docker save: Do not save to a terminal.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 115436e038a83ae24b0e89aefd8309133b013e1c
Component: engine
2014-10-06 09:50:40 -07:00
987f4f8cee integcli: fix permission detection for aufs
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 1a0347ff1dd1035066b5faf86db0587491b5d638
Component: engine
2014-09-19 21:08:57 +03:00
71e8f9134d integ-cli: test correct directory permissions
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: cc5fb986b03ce28075a9f3aee248d401f3be0c96
Component: engine
2014-09-08 20:02:40 +03:00
5583bba50b save many: adding an integration-cli test
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 79501dcd4f7a207067c234766ae4788007a1d91b
Component: engine
2014-08-28 21:33:13 -04:00
b15cf92d6a docker save: more integration tests
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Upstream-commit: 600f65b24786d15a382877da4c3ae77d88e252bb
Component: engine
2014-07-07 14:58:27 -04:00
2219ce0d97 add a test using the flags
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 6228761f67bb5f2af6c3105de556fa3fedb12069
Component: engine
2014-06-17 01:05:13 +00:00
4126b1978f improve test
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 614c57c52161c0440247a4e4e36808116214770e
Component: engine
2014-06-17 00:59:51 +00:00
375b426ef6 cli integration: sync container & image deletion
This makes container and image removal in the tests run synchronously.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: e09274476f889c08416a819dfb28f2c425868c6b
Component: engine
2014-04-04 03:22:32 +03:00
624997be0f initial version of cli integration tests
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 6db32fdefdae49843ed9535b3af1099e6bd2755d
Component: engine
2014-03-29 23:09:40 +02:00