Commit Graph

3403 Commits

Author SHA1 Message Date
6c2f2ddb74 Merge pull request #23343 from vdemeester/migrate-build-to-cobra
Use spf13/cobra for docker build
Upstream-commit: 3b08711bb75e30d850665312413a60f51114202f
Component: engine
2016-06-08 11:59:48 -07:00
74d1f25f8f Merge pull request #23002 from Microsoft/jjh/readonly
Windows: Support RO volumes 14350+
Upstream-commit: 393e97e435e7c1629934d8042d1fb8e5bb7d61f9
Component: engine
2016-06-08 11:18:48 -07:00
41181cb2ee Merge pull request #23377 from vdemeester/carry-pr-23007
Carry #23007 :  Say something useful during docker load
Upstream-commit: 9db33b7646854ed994b74d0e71bced087e617291
Component: engine
2016-06-08 13:42:22 -04:00
a9c87bb7fb Merge pull request #23375 from HackToday/fixnetworkmap
Fix wrong map usage
Upstream-commit: 148bcda3292563df8e433a3d7987810cd5702dec
Component: engine
2016-06-08 18:19:08 +02: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
9eb8ea5219 Fix wrong map usage
As map reference, if all networks use same, it could cause strange
results.
Closes: #23304
Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
Upstream-commit: 1cac7e6cbd3d1501d0fc29fc55b7ada981974998
Component: engine
2016-06-08 14:36:47 +00:00
ecda48bde7 Return remote API errors as JSON
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Upstream-commit: 322e2a7d059a81617b593cf6ece2cfd9f6d4ea03
Component: engine
2016-06-07 18:45:27 -07:00
9ca189a13d Windows: Support RO volumes 14350+
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 8d174a43babd19e8c1166338b5aa5f1128914a96
Component: engine
2016-06-07 14:55:36 -07:00
65f4a3fb13 Merge pull request #23311 from WeiZhang555/cobra-rm
Migrate rm command to cobra
Upstream-commit: ce96ce9e05d9b312b5454237680abadc7aa51092
Component: engine
2016-06-07 17:05:21 -04:00
fbb8bd9e59 Merge pull request #23338 from vdemeester/23253-fix-create-run
Fix create command flags
Upstream-commit: 8cd6977f98f4f51ee110a9795d1d93b9ec4b166c
Component: engine
2016-06-07 10:46:45 -07:00
216073fd2b Migrate docker build to cobra
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 60f447b655c960a48fa23e9eb86cc3bce4aeec37
Component: engine
2016-06-07 18:15:44 +02:00
94abb34940 add support for filtering by network ID
This adds support for filtering by network ID, to be
consistent with other filter options.

Note that only *full* matches are returned; this is
consistent with other filters (e.g. volume), that
also return full matches only.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7c46ba02e694ae540866b29ebf0dab76e556cc13
Component: engine
2016-06-07 16:50:31 +02:00
4e024e3e7d Adding network filter to docker ps command
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Upstream-commit: 912af1ae8f22c4d9d7e478d0985a40b41ded2027
Component: engine
2016-06-07 16:43:11 +02:00
238e9facc6 Migrate rm command to cobra
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 7702f39fe8e642dbaede34af09472f5aea66a795
Component: engine
2016-06-07 22:19:16 +08:00
3cb88d591b Fix TestRenameInvalidName
Change the test back to what it was before
e83dad090a1e890ac870808d776fa584276bf7ab

And added an extra test-case to check the
output if an incorrect number of arguments
is passed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 085f41b6a5764cba33fb5bda387f8ebe165d5828
Component: engine
2016-06-07 15:42:48 +02:00
a25abf1b60 Fix create command flags
Any command that expects extra flags after positional args needs to set flags.SetInterspersed(false).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: aa00520fc8bb4e04c37c2eb41f3bc3558deab533
Component: engine
2016-06-07 14:11:11 +02:00
08ad8f3172 Merge pull request #23269 from vdemeester/migrate-import-to-cobra
Use spf13/cobra for docker import
Upstream-commit: f061f556f2d3819f293e76a434c8212d613eca6b
Component: engine
2016-06-07 13:07:30 +02:00
54aa4a7bec Merge pull request #22149 from vdemeester/deprecated-copy-endpoint
Deprecate /containers/(id or name)/copy endpoint
Upstream-commit: 148d2b8e4a7e4f669ba9e8db2adc2413fde27a07
Component: engine
2016-06-07 12:50:04 +02:00
582dec773d Merge pull request #23172 from michael-holzheu/PR-s390x-seccomp
Enable seccomp for s390x and ppc: s390x part
Upstream-commit: eb6b5a6448efe7a9450abb98f9a0ea1c4cf51913
Component: engine
2016-06-07 12:04:13 +02:00
5879215fd4 Merge pull request #23226 from HackToday/fixnetinspectId
Fix the network inspect id
Upstream-commit: f9021838b61f17b2de6c42e459a732652ee2d207
Component: engine
2016-06-07 10:02:17 +02:00
d313694ba9 Merge pull request #23290 from yongtang/23211-spf13-cobra-rename
Use spf13/cobra for docker rename
Upstream-commit: e83dad090a1e890ac870808d776fa584276bf7ab
Component: engine
2016-06-07 08:28:27 +02:00
69e243a9fc Merge pull request #23274 from WeiZhang555/cobra-attach
Move attach command to cobra
Upstream-commit: ab821f9f9bf15cb7d356c6e48729f706807488db
Component: engine
2016-06-06 21:16:45 -04:00
83ae608b78 Use spf13/cobra for docker rename
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker rename` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 70f7ccb304f9246bc9c2bfe0e30d3a2bd8fd42f8
Component: engine
2016-06-06 12:39:11 -07:00
0c22cb98b8 Merge pull request #23217 from clnperez/speedup-pushfail-tests
test trusted push: use a nonexistant hostname
Upstream-commit: 4f1c5772a8da16ac66fbf838b782af76fa4185a6
Component: engine
2016-06-06 10:12:42 -07:00
cfcc9cde2b Fix the network inspect id
This fixes #22231

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
Upstream-commit: 864e362aa05ed2207d71471780068e951fe9d02e
Component: engine
2016-06-06 15:26:07 +00:00
9a954be4f2 Move attach command to cobra.
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: eceb8625a94e3504fca7b27d8156bcf11a93bf4f
Component: engine
2016-06-06 22:28:57 +08:00
5cb7befa00 Enable seccomp for s390x
To implement seccomp for s390x the following changes are required:

1) seccomp_default: Add s390 compat mode

   On s390x (64 bit) we can run s390 (32 bit) programs in 32 bit
   compat mode. Therefore add this information to arches().

2) seccomp_default: Use correct flags parameter for sys_clone on s390x

   On s390x the second parameter for the clone system call is the flags
   parameter. On all other architectures it is the first one.

   See kernel code kernel/fork.c:

   #elif defined(CONFIG_CLONE_BACKWARDS2)
   SYSCALL_DEFINE5(clone, unsigned long, newsp, unsigned long, clone_flags,
                   int __user *, parent_tidptr,

   So fix the docker default seccomp rule and check for the second
   parameter on s390/s390x.

3) seccomp_default: Add s390 specific syscalls

  For s390 we currently have three additional system calls that should
  be added to the seccomp whitelist:

  - Other architectures can read/write unprivileged from/to PCI MMIO memory.
    On s390 the instructions are privileged and therefore we need system
    calls for that purpose:

    * s390_pci_mmio_write()
    * s390_pci_mmio_read()

  - Runtime instrumentation:

    * s390_runtime_instr()

4) test_integration: Do not run seccomp default profile test on s390x

   The generated profile that we check in is for amd64 and i386
   architectures and does not work correctly on s390x.

   See also: 75385dc216e ("Do not run the seccomp tests that use
   default.json on non x86 architectures")

5) Dockerfile.s390x: Add "seccomp" to DOCKER_BUILDTAGS

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Upstream-commit: bf2a577c131d8998eb6ecac986d80e1289e6c801
Component: engine
2016-06-06 08:13:22 -04:00
b9600bdf73 Fix TestDiffEmptyArgClientError O:)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 7878705dcc26804b5f6a562410aecdb8f3485b91
Component: engine
2016-06-06 13:58:29 +02:00
62fb401985 Migrate network command to cobra
- Migrates network command and subcommands (connect, create, disconnect,
  inspect, list and remove) to spf13/cobra
- Create a RequiredExactArgs helper function for command that require an
  exact number of arguments.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 4bd202b00f7859ebeb4ba87511a0618ad08d0605
Component: engine
2016-06-06 10:28:52 +02:00
fd0727c3a3 Merge pull request #22077 from cpuguy83/remote_volplugin_caps
Add support for volume scopes
Upstream-commit: 28dde09cdf2a48dcdb6ce665cd2b912175dfb871
Component: engine
2016-06-06 10:15:43 +02:00
bbcce85205 Merge pull request #23283 from yongtang/23211-spf13-cobra-diff
Use spf13/cobra for docker diff
Upstream-commit: 2becfab55fd8ad6ec1d02aea3cd6498a2f91ef68
Component: engine
2016-06-06 09:05:18 +02:00
03f6e5fc67 Merge pull request #23242 from vdemeester/migrate-rmi-to-cobra
Use spf13/cobra for docker rmi
Upstream-commit: e94be2f639804c5223ebb127faec845683410eb1
Component: engine
2016-06-05 15:29:01 -07:00
9c145d0655 Use spf13/cobra for docker diff
This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command `docker diff` to use spf13/cobra

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 5899afae52b10d2457848c6e62a7476835befef3
Component: engine
2016-06-05 15:13:55 -07:00
1a2a5dd2e3 Merge pull request #23280 from icecrime/remove_num_commands_test
Remove unnecessary check for number of commands
Upstream-commit: 951702a5679b5220bfb02497bc76b65137dff1e3
Component: engine
2016-06-05 23:25:48 +02:00
7339550c4b Use spf13/cobra for docker rmi
Moves image command rmi to `api/client/image/remove.go` and use cobra :)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 60e48bd6bd24c559ed92c7217cd7798c85cbb644
Component: engine
2016-06-05 22:40:35 +02:00
78cd3d76ac Merge pull request #23247 from thaJeztah/carry-22033-docker-ps-format-output
[Carry 22033] Add a check for size field in custom format string
Upstream-commit: 1a1083ae75ac0b1018510ab80bffeab415220886
Component: engine
2016-06-05 16:39:22 -04:00
da4d783e80 Add support for volume scopes
This is similar to network scopes where a volume can either be `local`
or `global`. A `global` volume is one that exists across the entire
cluster where as a `local` volume exists on a single engine.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 2f40b1b281a3be8f34d82a5170988ee46ea1f442
Component: engine
2016-06-05 15:37:15 -04:00
472381db0b Remove unnecessary check for number of commands
Testing for the number of commands in `help` output doesn't seem to
contribute much to the quality of the project, and adds additional
burden for the developer to update.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
Upstream-commit: dd7e59a40a4c93070f71adb3ec74021241586c21
Component: engine
2016-06-05 11:44:50 -07:00
86b04a6a8a Merge pull request #22489 from Microsoft/jjh/shell
Builder shell configuration
Upstream-commit: df1dd1322d5c9527be7187038ca3480404b1282b
Component: engine
2016-06-05 17:43:12 +02:00
cfe1b2e499 Merge pull request #23253 from vdemeester/carry-pr-23159
Carry #23159 : Use spf13/cobra for `docker run` and `docker create`
Upstream-commit: 6b4a46f28266031ce1a1315f17fb69113a06efe1
Component: engine
2016-06-04 18:55:23 +02:00
30f6f65a88 Merge pull request #23254 from thaJeztah/prepare-for-go-1.7
Bump engine-api 772250a752e34cacaeef7c92b8e0ddf43450b629, prepare for go 1.7
Upstream-commit: e975dadaa01de9e651f30ef11ffbc59473f07ae5
Component: engine
2016-06-04 16:07:27 +02:00
f790d372b6 Update TestHttpsInfoRogueCert for Go 1.7
The error message changed from

  remote error: bad certificate

To

  remote error: tls: bad certificate

In Go 1.7, so just checking for "bad certificate"
to make this test work on both Go 1.6 and 1.7

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 496adadcec4ba00d230e546239ddc10e4ea41dcf
Component: engine
2016-06-04 14:17:24 +02:00
30e84b2a8a Merge pull request #23248 from Microsoft/jjh/flakeytest
Windows: Turn off TestBuildDockerignoreComment
Upstream-commit: 843720257baf80659729fc5fef5495fe2f7ca170
Component: engine
2016-06-04 14:07:52 +02:00
27d26eeb56 Convert 'docker create' to use cobra and pflag
Return the correct status code on flag parsins errors.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 5ab24342258c70438ab8edf708ebc466b1677f38
Component: engine
2016-06-04 13:57:30 +02:00
47fe12cae3 Merge pull request #23241 from vdemeester/migrate-search-to-cobra
Use spf13/cobra for docker search
Upstream-commit: 521f79bf0e81fdc5ff87ab207b834e2beef4e790
Component: engine
2016-06-03 22:07:08 -04:00
d5ece41dcd Builder default shell
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: b18ae8c9ccc2eb6cf8aa947f25eb6f1d20089776
Component: engine
2016-06-03 13:54:31 -07:00
35da93382d Merge pull request #23234 from yongtang/23221-utf8-bom
Skip UTF-8 BOM bytes from Dockerfile and .dockerignore if exist
Upstream-commit: 2d40e36af89b24b03ec9a502652f713353cf600a
Component: engine
2016-06-03 22:28:48 +02:00
3aae74c466 Windows: Turn off TestBuildDockerignoreComment
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: d75aaa2ca07eb9d0ea464ac503080177091b3b1c
Component: engine
2016-06-03 13:23:35 -07:00
69ba7aeaeb Add a check for size field in custom format string
This fix addresses an issue where including the `{{.Size}}` format
field in conjunction with `docker ps --format`, without the `--size`
flag, would not correctly display the size of containers.

This is done by doing a check on the custom format string, and setting
the size flag on the options struct if the field is found. This struct
gets passed to the engine API which then generates the correct query.

An integration test is included which runs `docker ps --format "table
{{.Size}}"` without `--size`, and checks that the returned output is
not `0 B`.

Fixes #21991

As suggested by @cpuguy83, a parser is implemented to process the format
string as a template, and then traverses the template tree to determine
if `.Size` was called.

This was then reworked by making use of template execution with a
pre-processor struct that will set the `--size` option if the template
calls for the field.

The pre-processor now also sets a boolean in the context passed to the
writer. There is an integration test for this that calls `docker ps
--size --format "{{.Size}}"` and then checks that `size: {{.Size}}` is
not appended, as it would with previous behavior.

Finally, a change was made to the formatter to not automatically
add a `{{.Size}}` if a custom format is provided.

Signed-off-by: Paulo Ribeiro <paigr.io@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 55cdb6dcd0f709301573ddb9f3348f9288572b91
Component: engine
2016-06-03 21:59:10 +02:00
cb2dd312aa Use spf13/cobra for docker search
- Move image command search to `api/client/image/search.go`
- Use cobra :)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: a11ef10631dd9338aeda2e10fedea365a7471af1
Component: engine
2016-06-03 19:50:01 +02:00