Commit graph

3489 commits

Author SHA1 Message Date
Sebastiaan van Stijn
f061f556f2 Merge pull request #23269 from vdemeester/migrate-import-to-cobra
Use spf13/cobra for docker import
2016-06-07 13:07:30 +02:00
Vincent Demeester
148d2b8e4a Merge pull request #22149 from vdemeester/deprecated-copy-endpoint
Deprecate /containers/(id or name)/copy endpoint
2016-06-07 12:50:04 +02:00
Sebastiaan van Stijn
eb6b5a6448 Merge pull request #23172 from michael-holzheu/PR-s390x-seccomp
Enable seccomp for s390x and ppc: s390x part
2016-06-07 12:04:13 +02:00
Vincent Demeester
f9021838b6 Merge pull request #23226 from HackToday/fixnetinspectId
Fix the network inspect id
2016-06-07 10:02:17 +02:00
Vincent Demeester
e83dad090a Merge pull request #23290 from yongtang/23211-spf13-cobra-rename
Use spf13/cobra for docker rename
2016-06-07 08:28:27 +02:00
Brian Goff
ab821f9f9b Merge pull request #23274 from WeiZhang555/cobra-attach
Move attach command to cobra
2016-06-06 21:16:45 -04:00
Yong Tang
70f7ccb304 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>
2016-06-06 12:39:11 -07:00
Alexander Morozov
4f1c5772a8 Merge pull request #23217 from clnperez/speedup-pushfail-tests
test trusted push: use a nonexistant hostname
2016-06-06 10:12:42 -07:00
Kai Qiang Wu(Kennan)
864e362aa0 Fix the network inspect id
This fixes #22231

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-06-06 15:26:07 +00:00
Zhang Wei
eceb8625a9 Move attach command to cobra.
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-06 22:28:57 +08:00
Michael Holzheu
bf2a577c13 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: 75385dc216 ("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>
2016-06-06 08:13:22 -04:00
Vincent Demeester
7878705dcc
Fix TestDiffEmptyArgClientError O:)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-06 13:58:29 +02:00
Vincent Demeester
4bd202b00f
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>
2016-06-06 10:28:52 +02:00
Vincent Demeester
28dde09cdf Merge pull request #22077 from cpuguy83/remote_volplugin_caps
Add support for volume scopes
2016-06-06 10:15:43 +02:00
Vincent Demeester
2becfab55f Merge pull request #23283 from yongtang/23211-spf13-cobra-diff
Use spf13/cobra for docker diff
2016-06-06 09:05:18 +02:00
Zhang Wei
c498d4700d Bug fix: docker run -i --restart always hangs.
e.g.
```
$ docker run -i --restart always busybox sh
pwd
/
exit 11

<...hang...>
```

This is because Attach(daemon side) and Run(client side) both hangs on
WaitStop, if container is restarted too quickly, wait won't have chance
to get exit signal.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-06 10:16:07 +08:00
Alexander Morozov
e94be2f639 Merge pull request #23242 from vdemeester/migrate-rmi-to-cobra
Use spf13/cobra for docker rmi
2016-06-05 15:29:01 -07:00
Yong Tang
5899afae52 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>
2016-06-05 15:13:55 -07:00
Sebastiaan van Stijn
951702a567 Merge pull request #23280 from icecrime/remove_num_commands_test
Remove unnecessary check for number of commands
2016-06-05 23:25:48 +02:00
Vincent Demeester
60e48bd6bd
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>
2016-06-05 22:40:35 +02:00
Brian Goff
1a1083ae75 Merge pull request #23247 from thaJeztah/carry-22033-docker-ps-format-output
[Carry 22033] Add a check for size field in custom format string
2016-06-05 16:39:22 -04:00
Brian Goff
2f40b1b281 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>
2016-06-05 15:37:15 -04:00
Arnaud Porterie (icecrime)
dd7e59a40a
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>
2016-06-05 11:44:50 -07:00
Vincent Demeester
df1dd1322d Merge pull request #22489 from Microsoft/jjh/shell
Builder shell configuration
2016-06-05 17:43:12 +02:00
Tomasz Kopczynski
fb175bb367 Reimplementing builder tests for Dockerfile outside context as a unit test
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
2016-06-05 08:39:06 +02:00
Sebastiaan van Stijn
6b4a46f282 Merge pull request #23253 from vdemeester/carry-pr-23159
Carry #23159 : Use spf13/cobra for `docker run` and `docker create`
2016-06-04 18:55:23 +02:00
Vincent Demeester
e975dadaa0 Merge pull request #23254 from thaJeztah/prepare-for-go-1.7
Bump engine-api 772250a752e34cacaeef7c92b8e0ddf43450b629, prepare for go 1.7
2016-06-04 16:07:27 +02:00
Sebastiaan van Stijn
496adadcec
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>
2016-06-04 14:17:24 +02:00
Sebastiaan van Stijn
843720257b Merge pull request #23248 from Microsoft/jjh/flakeytest
Windows: Turn off TestBuildDockerignoreComment
2016-06-04 14:07:52 +02:00
Daniel Nephin
5ab2434225 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>
2016-06-04 13:57:30 +02:00
Brian Goff
521f79bf0e Merge pull request #23241 from vdemeester/migrate-search-to-cobra
Use spf13/cobra for docker search
2016-06-03 22:07:08 -04:00
John Howard
b18ae8c9cc Builder default shell
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-03 13:54:31 -07:00
Sebastiaan van Stijn
2d40e36af8 Merge pull request #23234 from yongtang/23221-utf8-bom
Skip UTF-8 BOM bytes from Dockerfile and .dockerignore if exist
2016-06-03 22:28:48 +02:00
John Howard
d75aaa2ca0 Windows: Turn off TestBuildDockerignoreComment
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-03 13:23:35 -07:00
Paulo Ribeiro
55cdb6dcd0
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>
2016-06-03 21:59:10 +02:00
Vincent Demeester
a11ef10631
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>
2016-06-03 19:50:01 +02:00
Vincent Demeester
428328908d
Deprecate /containers/(id or name)/copy endpoint
This endpoint has been deprecated since 1.8. Return an error starting
from this API version (1.24) in order to make sure it's not used for the
next API version and so that we can remove it some times later.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-03 19:38:03 +02:00
Alexander Morozov
c80a2f2937 Merge pull request #22898 from WeiZhang555/add-detach-event
Add detach event
2016-06-03 09:49:48 -07:00
Yong Tang
ea86320fcc Skip UTF-8 BOM bytes from Dockerignore if exist
This fix tries to address issues related to #23221 where Dockerignore
may consists of UTF-8 BOM. This likely happens when Notepad
tries to save a file as UTF-8 in Windows.

This fix skips the UTF-8 BOM bytes from the beginning of the
Dockerignore if exists.

Additional tests has been added to cover the changes in this fix.

This fix is related to #23221 (UTF-8 BOM in Dockerfile).

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-03 07:26:36 -07:00
Christy Perez
431e7b6573 trusted push test: Use a nonexistant hostname
Before, the TCP handshake had to time out (approx 30s) before
this test completed. If you use a hostname that doesn't resolve,
then it fails faster.

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
2016-06-03 08:41:58 -05:00
Yong Tang
678c80f925 Skip UTF-8 BOM bytes from Dockerfile if exists
This fix tries to address issues in #23221 where Dockerfile
may consists of UTF-8 BOM. This likely happens when Notepad
tries to save a file as UTF-8 in Windows.

This fix skips the UTF-8 BOM bytes from the beginning of the
Dockerfile if exists.

Additional tests has been added to cover the changes in this
fix.

This fix fixes #23221.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-03 06:16:50 -07:00
Sebastiaan van Stijn
020a86b3d9 Merge pull request #23107 from yongtang/23055-docker-search-limit
Add `--limit` option to `docker search`
2016-06-03 14:25:42 +02:00
Zhang Wei
83ad006d47 Add detach event
If we attach to a running container and stream is closed afterwards, we
can never be sure if the container is stopped or detached. Adding a new
type of `detach` event can explicitly notify client that container is
detached, so client will know that there's no need to wait for its exit
code and it can move forward to next step now.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-03 11:59:11 +08:00
Yong Tang
92f10fe228 Add --limit option to docker search
This fix tries to address the issue raised in #23055.
Currently `docker search` result caps at 25 and there is
no way to allow getting more results (if exist).

This fix adds the flag `--limit` so that it is possible
to return more results from the `docker search`.

Related documentation has been updated.

Additional tests have been added to cover the changes.

This fix fixes #23055.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-02 19:12:20 -07:00
Yong Tang
8913dace34 Add support for comment in .dockerignore
This fix tries to address the issue raised in #20083 where
comment is not supported in `.dockerignore`.

This fix updated the processing of `.dockerignore` so that any
lines starting with `#` are ignored, which is similiar to the
behavior of `.gitignore`.

Related documentation has been updated.

Additional tests have been added to cover the changes.

This fix fixes #20083.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-02 19:06:52 -07:00
Sven Dowideit
98c245c9e6 Merge pull request #23193 from allencloud/fix-typos
use grep to find all a/an typos
2016-06-02 18:45:08 -07:00
Thomas Leonard
b6c7becbfe
Add support for user-defined healthchecks
This PR adds support for user-defined health-check probes for Docker
containers. It adds a `HEALTHCHECK` instruction to the Dockerfile syntax plus
some corresponding "docker run" options. It can be used with a restart policy
to automatically restart a container if the check fails.

The `HEALTHCHECK` instruction has two forms:

* `HEALTHCHECK [OPTIONS] CMD command` (check container health by running a command inside the container)
* `HEALTHCHECK NONE` (disable any healthcheck inherited from the base image)

The `HEALTHCHECK` instruction tells Docker how to test a container to check that
it is still working. This can detect cases such as a web server that is stuck in
an infinite loop and unable to handle new connections, even though the server
process is still running.

When a container has a healthcheck specified, it has a _health status_ in
addition to its normal status. This status is initially `starting`. Whenever a
health check passes, it becomes `healthy` (whatever state it was previously in).
After a certain number of consecutive failures, it becomes `unhealthy`.

The options that can appear before `CMD` are:

* `--interval=DURATION` (default: `30s`)
* `--timeout=DURATION` (default: `30s`)
* `--retries=N` (default: `1`)

The health check will first run **interval** seconds after the container is
started, and then again **interval** seconds after each previous check completes.

If a single run of the check takes longer than **timeout** seconds then the check
is considered to have failed.

It takes **retries** consecutive failures of the health check for the container
to be considered `unhealthy`.

There can only be one `HEALTHCHECK` instruction in a Dockerfile. If you list
more than one then only the last `HEALTHCHECK` will take effect.

The command after the `CMD` keyword can be either a shell command (e.g. `HEALTHCHECK
CMD /bin/check-running`) or an _exec_ array (as with other Dockerfile commands;
see e.g. `ENTRYPOINT` for details).

The command's exit status indicates the health status of the container.
The possible values are:

- 0: success - the container is healthy and ready for use
- 1: unhealthy - the container is not working correctly
- 2: starting - the container is not ready for use yet, but is working correctly

If the probe returns 2 ("starting") when the container has already moved out of the
"starting" state then it is treated as "unhealthy" instead.

For example, to check every five minutes or so that a web-server is able to
serve the site's main page within three seconds:

    HEALTHCHECK --interval=5m --timeout=3s \
      CMD curl -f http://localhost/ || exit 1

To help debug failing probes, any output text (UTF-8 encoded) that the command writes
on stdout or stderr will be stored in the health status and can be queried with
`docker inspect`. Such output should be kept short (only the first 4096 bytes
are stored currently).

When the health status of a container changes, a `health_status` event is
generated with the new status. The health status is also displayed in the
`docker ps` output.

Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-06-02 23:58:34 +02:00
Vincent Demeester
eb9274844e Merge pull request #23140 from Microsoft/HcsshimRevendor
Revendor hcsshim
2016-06-02 22:09:19 +02:00
allencloud
c1be45fa38 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-06-02 17:17:22 +08:00
Alexander Morozov
28676fc04b Merge pull request #22769 from dnephin/integrate_cobra
Use spf13/cobra for the cli
2016-06-01 14:18:23 -07:00
Yong Tang
4455ec14b8 Remove deprecated -f flag on docker tag
The -f flag on docker tag has been deprecated in docker 1.10 and
is expected to be removed in docker 1.12.

This fix removed the -f flag on docker tag and also updated
deprecated.md.

NOTE: A separate pull request for engine-api has been opened to
cover the related changes.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-01 09:44:25 -07:00
Shijiang Wei
0a8386c8be remove deprecated feature of passing HostConfig at API container start
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-06-01 22:25:17 +08:00
Daniel Nephin
fc5a4514fb Use Args in cobra.Command to validate args.
Also re-use context.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-05-31 15:43:16 -07:00
Darren Stahl
d96e36cbbf Revendor hcsshim
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-05-31 14:42:01 -07:00
Daniel Nephin
667dcb0e8e Update usage and help to (almost) match the existing docker behaviour
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-05-31 14:41:37 -07:00
Vincent Demeester
edcc9577bf Merge pull request #22103 from coolljt0725/fix_22093
Fix docker create with duplicate volume failed to remove
2016-05-30 15:57:13 +02:00
Shijiang Wei
f80bfdf85c make the error message in TestRunSeccompDefaultProfile more precise
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-05-28 09:06:25 +08:00
Justin Cormack
cfca3255a8 Split the Seccomp tests into two
The Seccomp tests ran 11 tests in parallel and this appears to be
hitting some sort of bug on CI. Splitting into two tests means that
I can no longer repeoduce the failure on the slow laptop where I could
reproduce the failures before.

Obviously this does not fix the underlying issue, which I will
continue to investigate, but not having the tests failing a lot
before the freeze for 1.12 would be rather helpful.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-27 15:38:29 -07:00
Sebastiaan van Stijn
4441a6c4c6 Merge pull request #22716 from jmzwcn/issue22466-patches
Embedded DNS problem after renaming container. Step2:change in docker…
2016-05-27 23:27:42 +02:00
Arnaud Porterie
fd7ec4b9e5 Merge pull request #22912 from duglin/FixImportTest
Fix docker import test
2016-05-27 14:03:44 -07:00
Brian Goff
ec3ccde18b Merge pull request #22438 from yongtang/22420-inconsistent-tmpfs-behavior
Inconsistent --tmpfs behavior
2016-05-27 15:54:37 -04:00
Alexander Morozov
01409bf069 Merge pull request #22376 from vdemeester/use-dockerd-in-integration-cli
Use dockerd instead of docker daemon in integration-cli
2016-05-27 10:09:43 -07:00
Vincent Demeester
24d2ee8c48 Merge pull request #22984 from Microsoft/jjh/ttymessage
Better error on attach no tty
2016-05-27 16:57:36 +02:00
Yong Tang
397a6fefad Inconsistent --tmpfs behavior
This fix tries to address the issue raised in #22420. When
`--tmpfs` is specified with `/tmp`, the default value is
`rw,nosuid,nodev,noexec,relatime,size=65536k`. When `--tmpfs`
is specified with `/tmp:rw`, then the value changed to
`rw,nosuid,nodev,noexec,relatime`.

The reason for such an inconsistency is because docker tries
to add `size=65536k` option only when user provides no option.

This fix tries to address this issue by always pre-progating
`size=65536k` along with `rw,nosuid,nodev,noexec,relatime`.
If user provides a different value (e.g., `size=8192k`), it
will override the `size=65536k` anyway since the combined
options will be parsed and merged to remove any duplicates.

Additional test cases have been added to cover the changes
in this fix.

This fix fixes #22420.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-26 19:28:18 -07:00
Arnaud Porterie
8e924153e2 Merge pull request #22268 from Microsoft/jjh/continuationescape
Support platform semantic file paths through ESCAPE
2016-05-26 10:00:56 -07:00
Vincent Demeester
f87053b9c3
Use dockerd instead of docker daemon in integration-cli
Updating `integration-cli/daemon.go` to use `dockerd` instead of `docker
daemon` to start up the daemon.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-26 13:14:35 +02:00
Daniel Zhang
be072a8954 Embedded DNS problem after renaming container. Step2:change in docker/daemon side and add integration test
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
2016-05-26 12:59:44 +08:00
Alessandro Boch
f198dfd856 Update port info on network connect/disconnect
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-25 17:02:50 -07:00
John Howard
f7541b00b0 Better error on attach no tty
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-25 13:32:48 -07:00
Sebastiaan van Stijn
0fe4417a3b Merge pull request #22908 from vdemeester/7967-since-before-image-filters
Add before and since filter to images
2016-05-25 20:15:23 +02:00
David Calavera
60abc96acf Merge pull request #22943 from vdemeester/21769-fix-detach-keys
Fix escape-keys by preserving input if invalid
2016-05-25 09:53:53 -07:00
Vincent Demeester
004ce6b571 Merge pull request #22916 from duglin/FixNetTest
Fix flaky TestApiStatsNetworkStats test
2016-05-25 18:51:47 +02:00
Sebastiaan van Stijn
8c70ab803c Merge pull request #22953 from Microsoft/jjh/TestRunWorkingDirectory
Windows: Fix TestRunWorkingDirectory
2016-05-25 17:54:39 +02:00
Sebastiaan van Stijn
4d376e9cc2 Merge pull request #22960 from justincormack/seccompdefnotarm
Do not run the seccomp tests that use default.json on non x86 architectures
2016-05-25 17:20:16 +02:00
Vincent Demeester
750e16f57c
Add before and since filter to images
Add support for two now filter on the `images` command : `before` and
`since`. They work the same as the one on the `ps` command but for
images.

        $ docker images --filter before=myimage
        # display all images older than myimage
        $ docker images --filter since=myimage
        # display all images younger than myimage

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-25 13:49:10 +02:00
Vincent Demeester
2a4b4a8133 Merge pull request #22962 from normalfaults/b
fixed spelling error in windows.go
2016-05-25 12:21:08 +02:00
Sebastiaan van Stijn
cd159fba85 Merge pull request #22952 from tophj-ibm/multiarch_daemon_test_fix
Multi-arch: fix TestBuildOnDisabledBridgeNetworkDaemon
2016-05-25 10:19:41 +02:00
Yong Tang
90bd41a74d The option --add-host and --net=host should not be mutually exclusive.
This fix tries to address the issue raised in #21976 and allows
the options of `--add-host` and `--net=host` to work at the same time.

The documentation has been updated and additional tests have been
added to cover this change.

This fix fixes #21976.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-24 18:49:11 -07:00
Nirmal Mehta
59bb86a964 Merge branch 'master' into b 2016-05-24 21:43:45 -04:00
Nirmal Mehta
f91acbaee4 fixed spelling error in docker cli run test
Signed-off-by: Nirmal Mehta <nirmalkmehta@gmail.com>
2016-05-24 21:43:22 -04:00
Justin Cormack
75385dc216 Do not run the seccomp tests that use default.json on non x86 architectures
The generated profile that we check in is for amd64 and i386 architectures
and does not work correctly on arm as it is missing required syscalls,
and also specifies the architectures that are supported. It works on
ppc64le at the moment but better to skip the test as it is likely to
break in future.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-24 17:47:30 -07:00
Yong Tang
23821fe586 The option --dns, --dns-search, --dns-opt and --net=host should not be mutually exclusive.
This fix tries to address the issue raised in #21976 and allows
the options of `--dns`, `--dns-search`, `--dns-opt` and `--net=host`
to work at the same time.

The documentation has been updated and additional tests have been
added to cover this change.

This fix fixes #21976.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-24 16:03:26 -07:00
John Howard
257494bd0a Windows: Fix TestRunWorkingDirectory
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-24 15:13:06 -07:00
Christopher Jones
7832e2ae82 Multi-arch: fix TestBuildOnDisabledBridgeNetworkDaemon
Fixes the test by loading in the architecture specific busybox
image when the test daemon starts.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-05-24 16:33:49 -04:00
Alexander Morozov
38217d4353 Merge pull request #22932 from chenchun/fix_build
Fix building image  error if bridge network is disabled
2016-05-24 10:33:34 -07:00
Vincent Demeester
0fb6190243
Fix escape-keys by preserving input if invalid
Currently, using a custom detach key with an invalid sequence, eats a
part of the sequence, making it weird and difficult to enter some key
sequence.

This fixes by keeping the input read when trying to see if it's the key
sequence or not, and "writing" then is the key sequence is not the right
one, preserving the initial input.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-24 17:14:48 +02:00
Vincent Demeester
d76d38c7d0 Merge pull request #22590 from yongtang/22463-docker-daemon-events
Emit events for docker daemon
2016-05-24 11:05:39 +02:00
Chun Chen
a8d013495c Fix building image error if bridge network is disabled
Signed-off-by: Chun Chen <ramichen@tencent.com>
2016-05-24 16:20:26 +08:00
Alexander Morozov
d7dfe9103b Merge pull request #22541 from crosbymichael/graph-restore
Implement graph driver restore on reboot
2016-05-23 22:57:23 -07:00
Yong Tang
62014aaf9a Add filter for events emitted by docker daemon
This fix tries to cover the issue raised in #22463 by adding
filter for events emitted by docker daemon so that user could
utilize filter to receive events of interest.

Documentations have been updated for this fix.

Additional tests have been added to cover the changes in this fix.

This fix fixes #22463.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-23 19:00:47 -07:00
Yong Tang
382c152a73 Emit events for docker daemon
This fix tries to cover the issue raised in #22463 by emitting
events for docker daemon so that user could be notified by
scenarios like config reload, etc.

This fix adds the `daemon reload`, and events for docker daemon.

Additional tests have been added to cover the changes in this fix.

This fix fixes #22463.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-23 19:00:47 -07:00
Doug Davis
94d0571304 Fix flaky TestApiStatsNetworkStats test
It appears that on some systems apparmor gets in the way of libc.so.6
shared library being loaded - which means the ping fails.

To get around this if we run ping under `/lib64/ld-linux-x86-64.so.2`
then it works.  So we only do this for linux and only if the first attempt
fails. If this 2nd attempt fails then we'll show the original error to
the user for debugging.

Also s/Output/CombinedOutput/ to help debugging in the future. It didn't
show the real error msg.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-05-23 19:00:19 -07:00
Justin Cormack
3598f2e331 Fix error channel size in seccomp test
This was not changed when the additional tests were added.
It may be the reason for occasional test failures.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-23 18:14:55 -07:00
Michael Crosby
31e903b0e1 Remove restart test
This test is not applicable anymore now that containers are not stopped
when the daemon is restored.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-23 15:57:23 -07:00
Doug Davis
ac043c7db6 Fix docker import tests
For me when I run the test I see:
```
Downloading from http://nourl/bad
Importing    283 B
Untar re-exec error: exit status 1: output: unexpected EOF
```
and nothing about "dial tcp" so it appears that the output is
system dependent and therefore we can't really check it. I think
checking for non-zero exit code is sufficient so I'm removing this
string check.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-05-23 15:34:40 -07:00
Tomasz Kopczynski
cf2611f323 Reimplementing more builder integration tests as unit tests
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
2016-05-22 01:00:57 +02:00
John Howard
e8e3dd32c5 Support platform file paths through escape
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-20 20:29:59 -07:00
Fabrizio Soppelsa
e009ebdf4c
Add a --filter option to docker search
The filtering is made server-side, and the following filters are
supported:

* is-official (boolean)
* is-automated (boolean)
* has-stars (integer)

Signed-off-by: Fabrizio Soppelsa <fsoppelsa@mirantis.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-20 13:41:28 +02:00
Sebastiaan van Stijn
0e9009bae3 Merge pull request #22554 from justincormack/seccap
Align default seccomp profile with selected capabilities
2016-05-20 12:58:28 +02:00
Nirmal Mehta
f66f5d4bdc fixed spelling error in cli pull local test
Signed-off-by: Nirmal Mehta <nirmalkmehta@gmail.com>
2016-05-19 17:52:42 -05:00
Vincent Demeester
ebeb5a0422 Merge pull request #22481 from mrunalp/pid_container
Add support for --pid=container:<id>
2016-05-19 19:00:40 +02:00
Sebastiaan van Stijn
aac6008800
fix typo in variable
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-05-18 15:26:16 +02:00
Vincent Demeester
cbc404a083 Merge pull request #22785 from runcom/fix-flaky-network
TestPsGroupPortRange: allocate less ports
2016-05-18 11:08:10 +02:00
Mrunal Patel
fb43ef649b Add support for --pid=container:<id>
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-05-17 13:49:05 -04:00
Antonio Murdaca
bdb354f19b TestPsGroupPortRange: allocate less ports
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-05-17 12:23:37 +02:00
Alessandro Boch
6eb2b903a3 Docker changes for libnetwork vendoring b66c038
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-16 15:04:01 -07:00
Sebastiaan van Stijn
9de21de453 Merge pull request #22462 from Microsoft/jjh/22181unittests
Windows: Reduce CLI time, move some to unit tests
2016-05-13 00:27:29 +02:00
Alexander Morozov
95872b65fb Merge pull request #22636 from sean-jc/fix-oom-killer-tests
Add the swapMemorySupport requirement to OOM tests
2016-05-12 14:41:55 -07:00
Arnaud Porterie
e9117578a7 Merge pull request #22445 from yongtang/20936-22443-concurrent-connection
Docker pull/push with max concurrency limits.
2016-05-12 08:51:28 -07:00
Vincent Demeester
84a6818b11 Merge pull request #22622 from tkopczynski/20784-builder-intg2unit-tests
Reimplement some builder integration tests as unit tests
2016-05-12 10:29:39 +02:00
Yong Tang
7368e41c07 Docker pull/push with max concurrency limits.
This fix tries to address issues raised in #20936 and #22443
where `docker pull` or `docker push` fails because of the
concurrent connection failing.
Currently, the number of maximum concurrent connections is
controlled by `maxDownloadConcurrency` and `maxUploadConcurrency`
which are hardcoded to 3 and 5 respectively. Therefore, in
situations where network connections don't support multiple
downloads/uploads, failures may encounter for `docker push`
or `docker pull`.

This fix tries changes `maxDownloadConcurrency` and
`maxUploadConcurrency` to adjustable by passing
`--max-concurrent-uploads` and `--max-concurrent-downloads` to
`docker daemon` command.

The documentation related to docker daemon has been updated.

Additional test case have been added to cover the changes in this fix.

This fix fixes #20936. This fix fixes #22443.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-11 19:44:54 -07:00
Tomasz Kopczynski
18eeb39985 Reimplementing builder integration tests as unit tests
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
2016-05-11 22:13:39 +02:00
Justin Cormack
a01c4dc8f8 Align default seccomp profile with selected capabilities
Currently the default seccomp profile is fixed. This changes it
so that it varies depending on the Linux capabilities selected with
the --cap-add and --cap-drop options. Without this, if a user adds
privileges, eg to allow ptrace with --cap-add sys_ptrace then still
cannot actually use ptrace as it is still blocked by seccomp, so
they will probably disable seccomp or use --privileged. With this
change the syscalls that are needed for the capability are also
allowed by the seccomp profile based on the selected capabilities.

While this patch makes it easier to do things with for example
cap_sys_admin enabled, as it will now allow creating new namespaces
and use of mount, it still allows less than --cap-add cap_sys_admin
--security-opt seccomp:unconfined would have previously. It is not
recommended that users run containers with cap_sys_admin as this does
give full access to the host machine.

It also cleans up some architecture specific system calls to be
only selected when needed.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-11 09:30:23 +01:00
Alexander Morozov
af60a9e599 Merge pull request #22511 from crosbymichael/update-runc-containerd
Update runc and containerd deps
2016-05-10 15:06:23 -07:00
Sean Christopherson
adabb51311 Add the swapMemorySupport requirement to OOM tests
Add the swapMemorySupport requirement to all tests related to the OOM killer.  The --memory option has the subtle side effect of defaulting --memory-swap to double the value of --memory.  The OOM killer doesn't kick in until the container exhausts memory+swap, and so without the memory swap cgroup the tests will timeout due to swap being effectively unlimited.

Document the default behavior of --memory-swap in the docker run man page.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
2016-05-10 11:28:00 -07:00
Justin Terry
47ef6d7969 Adds a correct error string for network validation
Fixes the negative networking test to include the new error string
from recent Windows builds.

Signed-off-by: Justin Terry <juterry@microsoft.com>
2016-05-09 16:37:14 -07:00
Michael Crosby
6889c3276c Fix containerd proto for connection
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-09 15:17:10 -07:00
Brian Goff
c5e3644f03 Merge pull request #22562 from tonistiigi/fix-loopback-release
Clean loopbacks in TestDaemonNoSpaceLeftOnDeviceError
2016-05-09 13:28:08 -04:00
Alexander Morozov
fad0305ee3 Merge pull request #22574 from yongtang/05072016-remove-deprecated-trust-env
Remove deprecated Docker Content Trust ENV passphrase variables
2016-05-09 10:10:27 -07:00
Doug Davis
0687d76ab1 Err was never being returned
Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-05-08 05:51:59 -07:00
Yong Tang
1f0d5aba50 Remove deprecated Docker Content Trust ENV passphrase variables
Since 1.9, Docker Content Trust Offline key has been renamed to
Root key and the Tagging key has been renamed to Repository key.
The corresponding environment variables
`DOCKER_CONTENT_TRUST_OFFLINE_PASSPHRASE`
`DOCKER_CONTENT_TRUST_TAGGING_PASSPHRASE`
have also been deprecated and renamed to
`DOCKER_CONTENT_TRUST_ROOT_PASSPHRASE`
`DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE`

This fix removed the deprecated ENV passphrase variables for
1.12 and updated the docs.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-07 14:25:28 -07:00
Vincent Demeester
08ec3606f1 Merge pull request #21889 from cpuguy83/logscmd_add_attrs
Add support for reading logs extra attrs
2016-05-07 20:26:33 +02:00
Lei Jitang
5e5e1d7ada Fix docker create with duplicate volume failed to remove
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-05-06 22:48:02 -04:00
Brian Goff
bd9d14a07b Add support for reading logs extra attrs
The jsonlog logger currently allows specifying envs and labels that
should be propagated to the log message, however there has been no way
to read that back.

This adds a new API option to enable inserting these attrs back to the
log reader.

With timestamps, this looks like so:
```
92016-04-08T15:28:09.835913720Z foo=bar,hello=world hello
```

The extra attrs are comma separated before the log message but after
timestamps.

Without timestaps it looks like so:
```
foo=bar,hello=world hello
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-05-06 20:42:20 -04:00
Tonis Tiigi
47c353eb46 Clean loopbacks in TestDaemonNoSpaceLeftOnDeviceError
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-05-06 14:19:27 -07:00
John Howard
faab71701f Windows: Reduce CLI time, move some to unit tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-06 12:26:08 -07:00
Vincent Demeester
f65f4dc761 Merge pull request #22501 from michael-holzheu/22477-TestApiStatsContainerGetMemoryLimit-add-mem-cgroup-test
TestApiStatsContainerGetMemoryLimit: Add cgroup memory test
2016-05-06 09:12:27 +02:00
Brian Goff
e9bef66021 Merge pull request #21961 from yongtang/21956-docker-inspect-log-default-options
Docker inspect gave default log options even when the option is emtpy.
2016-05-05 21:02:39 -04:00
Vincent Demeester
bb125650c9 Merge pull request #21015 from cpuguy83/add_opaque_mount_id
When calling volume driver Mount, send opaque ID
2016-05-05 18:00:15 +02:00
Brian Goff
0d3d8d6416 Merge pull request #22505 from runcom/authz-load-import
integration-cli: test load/import with authz plugins
2016-05-05 11:37:20 -04:00
Vincent Demeester
378a8e7175 Merge pull request #22508 from Microsoft/jjh/arg
Windows: Support ARG in builder
2016-05-05 09:09:55 +02:00
John Howard
6b5c83bf18 Windows: Support ARG in builder
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-04 14:32:23 -07:00
Alexander Morozov
e4a4570369 Merge pull request #22475 from Microsoft/jjh/twoconcurrentcontainers
Reduce time for TestRunTwoConcurrentContainers
2016-05-04 12:38:13 -07:00
Michael Holzheu
8ba8189ee6 TestApiStatsContainerGetMemoryLimit: Add cgroup memory test
Currently on kernels booted without the "cgroup_enable=memory" kernel
parameter the testcase TestApiStatsContainerGetMemoryLimit fails with:

FAIL: docker_api_stats_test.go:231: TestApiStatsContainerGetMemoryLimit.pN52_github_com_docker_docker_integration_cli.DockerSuite

docker_api_stats_test.go:256:
    c.Assert(fmt.Sprintf("%d", v.MemoryStats.Limit), checker.Equals, fmt.Sprintf("%d", info.MemTotal))
... obtained string = "0"
... expected string = "33759145984"

Fix this and skip the testcase if the kernel does not support cgroup memory
limit. In that case the output would be:

SKIP: docker_api_stats_test.go:231:
TestApiStatsContainerGetMemoryLimit.pN52_github_com_docker_docker_integration_cli.DockerSuite
(Test requires an environment that supports cgroup memory limit.)

ChangeLog:
----------
v4: Move TestApiStatsContainerGetMemoryLimit to docker_api_stats_unix_test.go
v3: Use existing "memoryLimitSupport" from requirements_unix.go
v2: Move check to requirements.go

Fixes #22477

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2016-05-04 20:46:41 +02:00
Antonio Murdaca
9613acbe5c integration-cli: test load/import with authz plugins
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-05-04 18:45:22 +02:00
John Howard
481cc6716f RunSleepingContainer consistency
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-03 11:39:29 -07:00
John Howard
94f1e574b6 Reduce time for TestRunTwoConcurrentContainers
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-03 10:55:20 -07:00
Yong Tang
4b5404f15e Docker inspect gave default log options even when the option is emtpy.
This fix tries to addess the issue in #21956 where `docker inspect`
will overwrite the log config options with default option even when
the `--log-driver` is not empty and `--log-opt` is empty. In this
situation, `docker inspect` and `docker run` is different.

With the introduction of #21153, the `HostConfig` will always have
the correct log-driver and log-opt values.

However, the previous processing of `docker inspect` was not updated
after the change in #21153. This results in the incorrect behavior.

This fix addresses this issue by updating `docker inspect` to conform
to #21153 so the the behavior of `docker inspect` and `docker run` is
consistent.

A integration test has been added to cover this fix.

This fix fixes #21956. This fix is related to #21153.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-02 21:14:42 -07:00
Tonis Tiigi
641c1808e1 Move implicit pull test to use local registry
Using hub only works for amd64 platforms.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-05-02 18:14:13 -07:00
Brian Goff
75e63c942e Merge pull request #21153 from mountkin/log-validator
inherit the daemon log options when creating containers
2016-05-02 16:12:43 -04:00
Aaron Lehmann
2f6e3b0ba0 Merge pull request #22448 from twistlock/authorization_error_code
Fix authorization issue - when request is denied return forbbiden exist code (403).
2016-05-02 11:04:19 -07:00
Liron Levin
526abc00b1 Fix authorization issue - when request is denied return forbbiden exist code (403).
- Return 403 (forbidden) when request is denied in authorization flows
(including integration test)
- Fix #22428
- Close #22431

Signed-off-by: Liron Levin <liron@twistlock.com>
2016-05-02 19:14:48 +03:00
Shijiang Wei
1790980ec6 inherit the daemon log options when creating containers
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-05-02 23:04:04 +08:00
Vincent Demeester
54ebe42de9
Fix #22240 do not pull all the tags implicitely
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-01 14:46:04 +02:00
Sebastiaan van Stijn
23e418b6c9
Add "driver" filter for network ls
This add a new filter to 'docker network ls'
to allow filtering by driver-name.

Contrary to "ID" and "name" filters, this
filter only supports an *exact* match.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-04-29 16:22:26 +02:00
Brian Goff
2b6bc294fc When calling volume driver Mount, send opaque ID
This generates an ID string for calls to Mount/Unmount, allowing drivers
to differentiate between two callers of `Mount` and `Unmount`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-04-29 09:37:02 -04:00
Sebastiaan van Stijn
bf7307558e Merge pull request #22269 from coolljt0725/skip
Skip TestBuildNotVerboseFailure if no network
2016-04-28 11:19:56 +02:00
Vincent Demeester
78eb8a5fb9 Merge pull request #21641 from yongtang/21595-discrepancy-on-hostname-validation
API/CLI discrepancy on hostname validation (#21595).
2016-04-28 09:25:13 +02:00
Lei Jitang
9ab0aa4336 Skip TestBuildNotVerboseFailure if no network
TestBuildNotVerboseFailure use a non-exist image busybox1,
it requires network connection to access to Dockerhub, skip
this test if there is no network.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-04-27 21:29:05 -04:00
Kai Qiang Wu(Kennan)
0656105710 Add load/save image event support
For every docker load and save operations, it would log related
image events.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-04-27 01:11:03 +00:00