Commit graph

4149 commits

Author SHA1 Message Date
John Howard
9127818414 Windows: Honour escape directive fully
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-21 14:22:14 -07:00
Antonio Murdaca
63b5a37203
api/server/router/system: fix info versioning
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-10-21 12:32:23 +02:00
Aaron Lehmann
bc52939b04 Merge pull request #27613 from stevvooe/archive-package-cleanup
pkg/archive: remove unnecessary Archive and Reader type
2016-10-20 20:56:23 -07:00
Stephen J Day
aa2cc18745
pkg/archive: remove unnecessary Archive and Reader type
The `archive` package defines aliases for `io.ReadCloser` and
`io.Reader`. These don't seem to provide an benefit other than type
decoration. Per this change, several unnecessary type cases were
removed.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-10-20 19:31:24 -07:00
Aaron Lehmann
2c620d0aa2 Merge pull request #27287 from mavenugo/pluginv2-sk2
Allow multiple handlers to support network plugins in swarm-mode
2016-10-20 13:43:04 -07:00
Daniel Nephin
b06c352783 Generate api/types:Image from the swagger spec
and rename it to a more appropriate name ImageSummary.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-10-20 13:24:23 -07:00
Vincent Demeester
13fd75c3dd Merge pull request #27470 from runcom/expose-exec-pid
record pid of exec'd process
2016-10-20 21:36:21 +02:00
Alexander Morozov
c18fbc9455 Merge pull request #22337 from allencloud/support-insecure-registry-config-reload
support insecure registry in configuration reload
2016-10-20 11:41:23 -07:00
Antonio Murdaca
1808348136
record pid of exec'd process
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-10-20 17:06:11 +02:00
Yong Tang
9ce8aac55e Show volume options for docker volume inspect
This fix tries to address the issue raised in 25545 where
volume options at the creation time is not showed up
in `docker volume inspect`.

This fix adds the field `Options` in `Volume` type and
persist the options in volume db so that `volume inspect`
could display the options.

This fix adds a couple of test cases to cover the changes.

This fix fixes 25545.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-20 05:14:27 -07:00
Vincent Demeester
1b677816f5 Merge pull request #24594 from jwendell/24355
Exec: Add ability to set environment variables
2016-10-20 13:26:48 +02:00
allencloud
582803f00a support insecure registry in configuration reload
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-20 07:54:31 +08:00
Vincent Demeester
4a4f028c47 Merge pull request #23036 from yongtang/22471-daemon-shutdown-timeout-daemon
Add config parameter to change stop timeout during daemon shutdown
2016-10-19 18:47:50 +02:00
Andy Goldstein
fc8097f957 Add Logs to ContainerAttachOptions
Signed-off-by: Andy Goldstein <agoldste@redhat.com>
2016-10-19 11:39:00 -04:00
Jonh Wendell
e03bf1221e Exec: Add ability to set environment variables
Keeping the current behavior for exec, i.e., inheriting
variables from main process. New variables will be added
to current ones. If there's already a variable with that
name it will be overwritten.

Example of usage: docker exec -it -e TERM=vt100 <container> top

Closes #24355.

Signed-off-by: Jonh Wendell <jonh.wendell@redhat.com>
2016-10-19 12:39:25 -02:00
John Howard
b8977ae537 Windows: Cred spec test with well form credentials
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-18 12:17:56 -07:00
Aaron Lehmann
6d4b527699 Service update failure thresholds and rollback
This adds support for two enhancements to swarm service rolling updates:

- Failure thresholds: In Docker 1.12, a service update could be set up
  to either pause or continue after a single failure occurs. This adds
  an --update-max-failure-ratio flag that controls how many tasks need to
  fail to update for the update as a whole to be considered a failure. A
  counterpart flag, --update-monitor, controls how long to monitor each
  task for a failure after starting it during the update.

- Rollback flag: service update --rollback reverts the service to its
  previous version. If a service update encounters task failures, or
  fails to function properly for some other reason, the user can roll back
  the update.

SwarmKit also has the ability to roll back updates automatically after
hitting the failure thresholds, but we've decided not to expose this in
the Docker API/CLI for now, favoring a workflow where the decision to
roll back is always made by an admin. Depending on user feedback, we may
add a "rollback" option to --update-failure-action in the future.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-10-18 10:09:50 -07:00
Yong Tang
d7be6b2deb Add config parameter to change stop timeout during daemon shutdown
This fix tries to add a daemon config parameter `--shutdown-timeout`
that specifies the timeout value to stop containers gracefully
(before SIGKILL). The default value is 15s.

The `--shutdown-timeout` parameter is added to daemon options and
config file. It will also be updated during daemon reload.

Additional test cases have been added to cover the change.

This fix fixes #22471.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-18 08:07:50 -07:00
Yong Tang
e4c9079d09 Remove duplicate keys in labels of docker info
This fix tries to address the issue raised in 24392 where
labels with duplicate keys exist in `docker info`, which
contradicts with the specifications in the docs.

The reason for duplicate keys is that labels are stored as
slice of strings in the format of `A=B` (and the input/output).

This fix tries to address this issue by checking conflict
labels when daemon started, and remove duplicate labels (K-V).

The existing `/info` API has not been changed.

An additional integration test has been added to cover the
changes in this fix.

This fix fixes 24392.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-18 07:45:27 -07:00
Yong Tang
e66d210891 Add config parameter to change per-container stop timeout during daemon shutdown
This fix tries to add a flag `--stop-timeout` to specify the timeout value
(in seconds) for the container to stop before SIGKILL is issued. If stop timeout
is not specified then the default timeout (10s) is used.

Additional test cases have been added to cover the change.

This fix is related to #22471. Another pull request will add `--shutdown-timeout`
to daemon for #22471.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-17 12:28:46 -07:00
Madhu Venugopal
af185a3806 IT for e2e network-plugin support for swarmkit & services
As of https://github.com/docker/swarmkit/pull/1607, swarmkit honors
global network plugins while allocating network resources.

This IT covers the e2e integration between libnetwork, swarmkit and
docker engine to support global network-plugins for swarm-mode

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-10-17 09:00:36 -07:00
Vincent Demeester
a7c883fb04 Merge pull request #27074 from cyli/bump-notary-version
Bump notary version to 0.4.2
2016-10-17 16:35:57 +02:00
Akihiro Suda
bb17d1fabb [test] fix failure of TestBuildLabelsOverride on Windows
TestBuildLabelsOverride was consistently failing due to "Windows does not support FROM scratch" error

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-10-16 11:05:31 +00:00
Sebastiaan van Stijn
6f54d70a54 Merge pull request #27174 from duglin/Issue26027
Don't env-var evaluate labels from docker build cmd line
2016-10-14 20:57:41 -07:00
Tõnis Tiigi
4a6b37eb3e Merge pull request #27322 from yongtang/25855-deploy-dab-extension
Allow `docker deploy` command accept stack with/without extension
2016-10-14 18:26:49 -07:00
Tõnis Tiigi
1221294386 Merge pull request #27368 from morelena/move_close
integration-cli: move Close() after error check
2016-10-14 18:25:36 -07:00
cyli
0797af39c2 Fix API incompatibilities between notary v0.3.0 and v0.4.2:
- some function signatures have changed - use the new ones
- re-generate the notary delegation key certs, since notary doesn't allow SHA1
- fix some error message mapping because now if a root rotation fails to validate trusted operations will fail

Signed-off-by: cyli <cyli@twistedmatrix.com>
2016-10-14 17:53:34 -07:00
Yong Tang
1e9d04c458 Allow docker deploy command accept filename with/without extension
This fix tries to address the issue raised in 25855 where the command
`docker deploy` can only accept a STACK without extension of `.dab`.
In other words, `docker deploy hellojavaee.dab` gives an error:
```
Bundle hellojavaee.dab.dab not found. Specify the path with --file
```

This fix updates the way namespace STACK is taken so that in case
`STACK.dab` is provided with `docker deploy`:
```
$ docker deploy STACK.dab
```
The `STACK` is used as namespace (instead of `STACK.dab`).

NOTE: This fix will only allows `.dab` extension in namespace, because
it is not possible to have a namespace with `.` in the middle. In other
words, a namespace `hello.java.ee` will not work anyway (whether the file
`hello.java.ee` exists or not).

An additional integration test has been added to cover the changes.

This fix fixes 25855.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-14 11:44:15 -07:00
Sebastiaan van Stijn
dd383898cd Merge pull request #26795 from darrenstahlmsft/PauseResume
Implement Pause Resume support for Windows
2016-10-13 18:08:11 -07:00
Elena Morozova
2b9786a9b3 integration-cli: move Close() after error check
Signed-off-by: Elena Morozova <lelenanam@gmail.com>
2016-10-13 16:07:08 -07:00
Elena Morozova
64238fef8c all: replace loop with single append
Signed-off-by: Elena Morozova <lelenanam@gmail.com>
2016-10-13 13:31:52 -07:00
Tibor Vass
535f52c932 Merge pull request #27296 from tonistiigi/wait-tasks
Wait until tasks have been created in TestSwarmTaskListFilter
2016-10-13 15:02:43 +02:00
Tonis Tiigi
da9ef68f06 Add requirements for tests that require network
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-12 11:11:23 -07:00
Vincent Demeester
9db4698929 Merge pull request #27217 from Microsoft/jjh/servicingcitest
Windows: Test for container servicing
2016-10-12 15:50:52 +02:00
Vincent Demeester
310068f606 Merge pull request #27225 from darrenstahlmsft/CreateTests
Windows: Enable more create tests
2016-10-12 15:08:32 +02:00
Darren Stahl
69985e85d3 Implement Pause Resume support for Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-10-11 16:23:35 -07:00
Aaron Lehmann
9bd8c1d332 Merge pull request #26804 from stevvooe/clear-tlsconfig-unix-socket
client: pedantic checking of tlsconfig
2016-10-11 15:47:47 -07:00
Tonis Tiigi
f8229aea9f Wait until tasks have been created in TestSwarmTaskListFilter
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-11 11:56:42 -07:00
Justin Cormack
199e19548e Add support for ambient capabilities
Linux kernel 4.3 and later supports "ambient capabilities" which are the
only way to pass capabilities to containers running as a non root uid.

Previously there was no way to allow containers not running as root
capabilities in a useful way.

Fix #8460

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-10-10 19:29:02 +01:00
Darren Stahl
45fe59931a Windows: Enable more create tests
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-10-10 10:34:03 -07:00
John Howard
25a148918e Windows: Test for container servicing
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-07 10:47:54 -07:00
Vincent Demeester
b3cc3d7bf9 Merge pull request #23389 from Microsoft/jjh/credentialspec
Windows: Support credential specs
2016-10-07 18:32:44 +02:00
Vincent Demeester
e42ec6d7cb Merge pull request #27171 from tonistiigi/improve-attach-closed
Improve TestAttachClosedOnContainerStop
2016-10-07 11:26:33 +02:00
Vincent Demeester
91312f71aa Merge pull request #26882 from runcom/proxy-path
Specify userland proxy path
2016-10-07 09:44:39 +02:00
Darren Stahl
6482410c9d Enabled more test on Windows, API and Build
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-10-06 17:18:42 -07:00
Justin Cormack
5ee2c2a647 Merge pull request #27160 from mlaventure/update-containerd
Update containerd and runc
2016-10-06 19:36:31 +02:00
John Howard
e85867cb68 Windows: Support credential specs
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-06 09:32:22 -07:00
Antonio Murdaca
dd2e1947dc
daemon: add --userland-proxy-path flag
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-10-06 17:31:53 +02:00
Darren Stahl
443d7313f5 Enable more build tests on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-10-06 00:53:30 -07:00
Doug Davis
28a9a7deb0 Don't env-var evaluate labels from docker build cmd line
Fixes #26027

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-10-05 18:17:02 -07:00
Tonis Tiigi
9d8f01b4f5 Improve TestAttachClosedOnContainerStop
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-05 15:52:09 -07:00
Kenfe-Mickael Laventure
7e12c3bb99 Update containerd and runc
containerd: 837e8c5e1cad013ed57f5c2090c8591c10cbbdae
runc: 02f8fa7863dd3f82909a73e2061897828460d52f

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-10-05 14:47:15 -07:00
Alexander Morozov
ba9fb73280 Merge pull request #27037 from Microsoft/jjh/apistatsdatarace
Fix datarace in ApiStatsNetworkStatsVersioning
2016-10-05 13:06:40 -07:00
John Howard
825e3a66a4 Fix datarace in ApiStatsnetworkStatsVersioning
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-05 10:12:46 -07:00
Doug Davis
105bc63295 Require continuation char to be last char in a line
While look at #27039 I noticed that we allow for whitespace after
the continuation char (\\) which is wrong. It needs to be the very
last char in the line.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-10-04 09:38:00 -07:00
Vincent Demeester
694ba71e36 Merge pull request #26989 from aboch/none
Respect --bridge=none
2016-10-04 16:25:39 +02:00
Michael Crosby
e22d4b9654 Merge pull request #27078 from darrenstahlmsft/InteractiveRestartTest
Increase timeout in TestRunInteractiveWithRestartPolicy
2016-10-03 11:22:33 -07:00
Alessandro Boch
a0af884d3a Respect --bridge=none
- Do not create the default "bridge" network
- Get rid of the docker0 bridge

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-10-03 11:08:34 -07:00
Brian Goff
7e29b33546 Merge pull request #26967 from AkihiroSuda/rename-tests
[nit] integration-cli: obey Go's naming convention
2016-10-03 09:52:04 -04:00
Vincent Demeester
420e22fad4 Merge pull request #27060 from yongtang/27021-inspect-show-env
Disable HTML escaping for JSON strings in `docker inspect`
2016-10-02 14:32:56 +02:00
Michael Crosby
18338427ed Merge pull request #26968 from darrenstahlmsft/TestEventsFix
Limit conccurent container creates in TestEventsLimit to 8
2016-09-30 16:29:01 -07:00
Darren Stahl
6eac29490f Increase timeout in TestRunInteractiveWithRestartPolicy
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-09-30 15:30:18 -07:00
Darren Stahl
728a265190 Limit conccurent container creates in TestEventsLimit to 8
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-09-30 14:44:05 -07:00
Michael Crosby
6eef2b2ada Merge pull request #26997 from tonistiigi/exec-env
Fix missing hostname and links in exec env
2016-09-30 09:51:02 -07:00
Vincent Demeester
4fabc92cfc Merge pull request #26697 from allencloud/change-service-scale-logic
validate service parameter in client side to avoid api call in `docker service scale`
2016-09-30 18:37:35 +02:00
Akihiro Suda
7fb7a477d7 [nit] integration-cli: obey Go's naming convention
No substantial code change.

 - Api         --> API
 - Cli         --> CLI
 - Http, Https --> HTTP, HTTPS
 - Id          --> ID
 - Uid,Gid,Pid --> UID,PID,PID
 - Ipam        --> IPAM
 - Tls         --> TLS (TestDaemonNoTlsCliTlsVerifyWithEnv --> TestDaemonTLSVerifyIssue13964)

Didn't touch in this commit:
 - Git: because it is officially "Git": https://git-scm.com/
 - Tar: because it is officially "Tar": https://www.gnu.org/software/tar/
 - Cpu, Nat, Mac, Ipc, Shm: for keeping a consistency with existing production code (not changable, for compatibility)

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-30 01:21:05 +00:00
Yong Tang
0fa20ad13b Disable HTML escaping for JSON strings in docker inspect
This fix tries to address the issue raised in 27021 where
HTML strings like (`&, >, <, etc`) in environmental variables
are escaped for JSON output for `docker inspect`. For example,
`TEST_ENV="soanni&rtr"` has been escaped to `TEST_ENV="soanni\u0026rtr"`

This fix disabled HTML escaping with `SetEscapeHTML`, which is available
since golang 1.7.0. This changes will be applied to all JSON output
that utilize `httputils.WriteJSON`.

An integration test has been added to cover the changes.

This fix fixes 27021.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-29 18:16:36 -07:00
Tonis Tiigi
e981459609 Fix missing hostname and links in exec env
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-09-29 13:46:10 -07:00
Michael Crosby
1d669d82c1 Merge pull request #26994 from Microsoft/jjh/fix26461regression
Windows: Don't set PATH/TERM on exec
2016-09-29 13:34:12 -07:00
allencloud
6184ff312d change code in container restore
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-09-30 02:44:21 +08:00
Vincent Demeester
b6ad6d98fd Merge pull request #24411 from vdemeester/24393-ps-filter-managed
Add a new "is-task" ps filter
2016-09-29 18:54:15 +02:00
Alexander Morozov
2de05de98d integration: wait for task running in TestServiceHealthRun
Test can miss Starting state, so wait until its Running

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-09-29 07:44:00 -07:00
Andrew Hsu
64b5fe76cf integration test for missing arg error code
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-09-28 16:33:45 -07:00
John Howard
e880bbc48b Windows: Don't set PATH/TERM on exec
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-28 13:42:27 -07:00
Vincent Demeester
5280ba83e5
Add a new "is-task" ps filter
This makes it easier to list containers that are part of a task
(swarm mode) and those who are not.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-09-28 12:45:30 +02:00
Vincent Demeester
b0e1b8fc79 Merge pull request #24850 from yongtang/24270-service-tasks-filter
Fix partial/full filter issue in `service tasks --filter`
2016-09-28 11:50:27 +02:00
Misty Stanley-Jones
bab64af2ad Merge pull request #26931 from thaJeztah/fix-aux-address-example
Fix incorrect aux-address examples and test
2016-09-27 17:06:01 -07:00
Stephen J Day
dc9f5c2ca3
client: pedantic checking of tlsconfig
Under the convoluted code path for the transport configuration,
TLSConfig was being set even though the socket type is unix. This caused
other code detecting the TLSConfig to assume https, rather than using
the http scheme. This led to a situation where if `DOCKER_CERT_PATH` is
set, unix sockets start reverting to https. There is other odd behavior
from go-connections that is also reproduced here.

For the most part, we try to reproduce the side-effecting behavior from
go-connections to retain the current docker behavior. This whole mess
needs to ripped out and fixed, as this pile spaghetti is unnacceptable.

This code is way to convoluted for an http client. We'll need to fix
this but the Go API will break to do it.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-09-27 16:27:48 -07:00
Vincent Demeester
b881148385 Merge pull request #26255 from Microsoft/jjh/xenon-test-infrastructure
Add isolation to info - enables Hyper-V containers CI bring-up
2016-09-27 18:46:51 +02:00
Sebastiaan van Stijn
fd7161bb30
Fix incorrect aux-address examples and test
The (host)name for aux-addresses should
be unique, otherwise later values overwrite
earlier values.

Before this change, the example command
would send this API request;

    {
      "Attachable": false,
      "CheckDuplicate": true,
      "Driver": "overlay",
      "EnableIPv6": false,
      "IPAM": {
        "Config": [
          {
            "Gateway": "192.168.0.100",
            "IPRange": "192.168.1.0/24",
            "Subnet": "192.168.0.0/16"
          },
          {
            "AuxiliaryAddresses": {
              "a": "192.170.1.5",
              "b": "192.170.1.6"
            },
            "Gateway": "192.170.0.100",
            "Subnet": "192.170.0.0/16"
          }
        ],
        "Driver": "default",
        "Options": {
        }
      },
      "Internal": false,
      "Labels": {
      },
      "Name": "my-multihost-network",
      "Options": {
      }
    }

After this change, the request looks
like this (all aux-addresses preserved);

    {
      "Attachable": false,
      "CheckDuplicate": true,
      "Driver": "overlay",
      "EnableIPv6": false,
      "IPAM": {
        "Config": [
          {
            "AuxiliaryAddresses": {
              "my-router": "192.168.1.5",
              "my-switch": "192.168.1.6"
            },
            "Gateway": "192.168.0.100",
            "IPRange": "192.168.1.0/24",
            "Subnet": "192.168.0.0/16"
          },
          {
            "AuxiliaryAddresses": {
              "my-printer": "192.170.1.5",
              "my-nas": "192.170.1.6"
            },
            "Gateway": "192.170.0.100",
            "Subnet": "192.170.0.0/16"
          }
        ],
        "Driver": "default",
        "Options": {
        }
      },
      "Internal": false,
      "Labels": {
      },
      "Name": "my-multihost-network",
      "Options": {
      }
    }

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-27 01:12:29 +02:00
Yong Tang
f676fc93c3 Fix partial/full filter issue in service tasks --filter
This fix tries to address the issue related to 24108 and 24790, and
also the case from 24620#issuecomment-233715656

The reason for the failure case in the above mentioned issues is that
currently Task names are actually indexed by Service Name
(`e.ServiceAnnotations.Name`)

To fix it, a pull request in swarmkit (swarmkit/pull/1193) has been
opened separately.

This fix adds the integration tests for the above mentioned issues.
Swarmkit revendoring is needed to completely fix the issues.

This fix fixes 24108.
This fix fixes 24790.
This fix is related to 24620.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-26 16:01:20 -07:00
Aaron Lehmann
33466024e7 Merge pull request #26219 from dmcgowan/optimize-token-server-error-test
Update token server error test to not fail on retries
2016-09-26 23:17:09 +01:00
Victor Vieux
f67096c20b Merge pull request #26744 from LK4D4/attach_before_start
libcontainerd: attach streams before create
2016-09-26 13:08:05 -07:00
Sebastiaan van Stijn
a4dd51a660 Merge pull request #23886 from AkihiroSuda/stackcli
add `docker stack ls`
2016-09-26 21:19:04 +02:00
Arnaud Porterie
7944480dd0 Merge pull request #26839 from tonistiigi/build-cache
Implement build cache based on history array
2016-09-26 17:31:49 +00:00
allencloud
5ba203e73a validate service parameter in client side to avoid api call
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-09-26 17:18:02 +08:00
Yong Tang
de4871165b Improve error message for removing pre-defined (e.g., ingress) network
This fix tries to address the issue raised in 24538

where the error message is unclear when removing pre-defined networks:
```
docker network rm ingress
Error response from daemon: rpc error: code = 7 desc = 4vlxuzpk8bxdsxpyvkxluol5g is a pre-defined network and cannot be removed
```

This fix improve the error message so that if network's name is specified
in the `RemoveNetwork`, then error message will contain the name and the ID
(instead of just an ID):
```
docker network rm ingress
Error response from daemon: rpc error: code = 7 desc = ingress (4vlxuzpk8bxdsxpyvkxluol5g) is a pre-defined network and cannot be removed
```

An integration test has been added to cover the changes.

This fix fixes 24538.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-24 11:59:26 -07:00
John Howard
c4e1697274 Add isolation to info
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-23 12:13:29 -07:00
Jake Sanders
b264632904 make GetAll use client.List as the source of truth
Signed-off-by: Jake Sanders <jsand@google.com>
2016-09-23 11:48:15 -07:00
Tonis Tiigi
4b8e680bcc Add integration test for build —cache-from
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-09-23 11:30:34 -07:00
Phil Estes
57f0164fd2 Merge pull request #26834 from thaJeztah/deprecate-docker-daemon
Deprecate "daemon" subcommand
2016-09-23 08:51:18 -04:00
Vincent Demeester
72f556a9ff Merge pull request #26516 from yongtang/26453-build-bad-syntax
Check bad syntax on dockerfile before building.
2016-09-23 12:24:20 +02:00
Sebastiaan van Stijn
bf58dd82c3
Deprecate "daemon" subcommand
The daemon is in a separate (dockerd) binary
since docker 1.12, so should no longer be
used.

This marks the command as deprecated, and
adds it to the deprecated features list.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-23 00:26:27 +02:00
Akihiro Suda
5ce08ddfca add docker stack ls
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-22 19:31:39 +00:00
John Howard
34fe27f153 Windows: Remove hard coded base image
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-22 09:57:35 -07:00
Vincent Demeester
9e2178499a Merge pull request #26787 from Microsoft/jjh/14375hacks
Windows: Remove interim build hacks from tests
2016-09-22 11:12:02 +02:00
John Howard
b52c3ec4a4 Windows: Remove interim build hacks from tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-21 11:11:13 -07:00
Alexander Morozov
02d1934279 libcontainerd: attach streams before create
Fix #26371

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-09-21 09:16:12 -07:00
Alexander Morozov
ef4bcf23e6 integration: fix flaky TestSwarmServiceWithGroup
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-09-20 12:07:30 -07:00
Sebastiaan van Stijn
6eb6eaf718 Merge pull request #26720 from AkihiroSuda/fix-TestBuildApiDockerFileRemote
[test] Fix TestBuildApiDockerFileRemote
2016-09-20 17:57:01 +02:00
Akihiro Suda
f453261b4a Fix TestBuildApiDockerFileRemote
TestBuildApiDockerFileRemote has been consistently failing (EPERM) on the host
with #26618, which prohibits /sys/firmware from being accessed using apparmor.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-20 14:15:37 +00:00
Michael Crosby
ee3ac3aa66 Add init process for zombie fighting
This adds a small C binary for fighting zombies.  It is mounted under
`/dev/init` and is prepended to the args specified by the user.  You
enable it via a daemon flag, `dockerd --init`, as it is disable by
default for backwards compat.

You can also override the daemon option or specify this on a per
container basis with `docker run --init=true|false`.

You can test this by running a process like this as the pid 1 in a
container and see the extra zombie that appears in the container as it
is running.

```c

int main(int argc, char ** argv) {
	pid_t pid = fork();
	if (pid == 0) {
		pid = fork();
		if (pid == 0) {
			exit(0);
		}
		sleep(3);
		exit(0);
	}
	printf("got pid %d and exited\n", pid);
	sleep(20);
}
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-19 17:33:50 -07:00
Michael Crosby
69114bb3a7 Merge pull request #26442 from vieux/add_warning_plugin_rm
add check plugin is not used before rm
2016-09-19 16:03:17 -07:00
Sebastiaan van Stijn
bb6fe56e88 Merge pull request #26268 from AkihiroSuda/eventsjsonl
add `docker events --format`
2016-09-19 17:30:27 +02:00
John Howard
4a0419f536 Merge pull request #25737 from Microsoft/jjh-statistics
Windows: Add support for docker stats
2016-09-17 09:31:24 -07:00
Sebastiaan van Stijn
94bc2b1bc0 Merge pull request #26387 from Microsoft/jjh/securityopts
Only output security options if there are any
2016-09-16 23:05:30 +02:00
John Howard
340e5233b2 Windows: stats support
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-16 11:56:15 -07:00
John Howard
dd3d223a7e Only output security options if there are any
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-16 10:05:21 -07:00
Victor Vieux
b22d07f515 add check plugin is not used before rm
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-15 13:50:57 -07:00
Akihiro Suda
5af5a1be62 add docker events --format
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-15 09:55:29 +00:00
John Howard
39f5d97cde Merge pull request #26553 from darrenstahlmsft/FixWildcard
Windows: Fix wildcard expansion after slash in filename
2016-09-14 16:56:35 -07:00
Tõnis Tiigi
1573ea5974 Merge pull request #26552 from darrenstahlmsft/EnableBuildTests
Windows: Enable more build tests
2016-09-14 14:07:19 -07:00
Brian Goff
f8d6dedb6a Merge pull request #26574 from cpuguy83/fix_improper_use_in_test
Fix improper use of `--rm` in test case
2016-09-14 15:28:40 -04:00
Darren Stahl
309056648c Windows: Fix wildcard expansion after slash in filename
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-09-14 11:40:57 -07:00
Brian Goff
f05ed00758 Fix improper use of --rm in test case
Test is testing that a user can disconnect from the default network
before it is started (#26220).
This test does not need to use `--rm`, which is never aken into account
since the container is never started.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-09-14 13:14:30 -04:00
Alexander Morozov
397df22963 Merge pull request #26504 from tonistiigi/frozen-fix
Fix already loaded detection for frozen images
2016-09-14 08:22:48 -07:00
Sebastiaan van Stijn
8ac2000f50 Merge pull request #25540 from estesp/ro-plus-userns
Remove --read-only restriction when user ns enabled
2016-09-14 13:53:58 +02:00
Yong Tang
c8dc2b156a Check bad syntax on dockerfile before building.
This fix tries to address the issue raised in 26453 where bad syntax
on dockerfile is not checked before building, thus user has to wait
before seeing error in dockerfile.

This fix fixes the issue by evaluating all the instructions and check
syntax before dockerfile is invoked actually.

All existing tests pass.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-13 21:43:10 -07:00
Madhu Venugopal
1d76ab4f80 Merge pull request #26449 from mrjana/net
Fix autostart for swarm scope connected containers
2016-09-13 18:22:16 -07:00
Darren Stahl
e79b0b42f0 Windows: Enable more build tests
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-09-13 17:43:27 -07:00
Jana Radhakrishnan
c9fb551d60 Fix autostart for swarm scope connected containers
The swarm scope network connected containers with autostart enabled
there was a dependency problem with the cluster to be initialized before
we can autostart them. With the current container restart code happening
before cluster init, these containers were not getting autostarted
properly. Added a fix to delay the container start of those containers
which has atleast one swarm scope endpoint to until after the cluster is
initialized.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-13 14:21:58 -07:00
Daniel Nephin
a07be9be38 Use opts.FilterOpt for filter flags.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-13 16:20:10 -04:00
Brian Goff
b4c1645db5 Merge pull request #22373 from cpuguy83/add_mounts_api_on_create
Add new `HostConfig` field, `Mounts`.
2016-09-13 14:39:50 -04:00
Tõnis Tiigi
711455d34e Merge pull request #26503 from clnperez/swarm-test-move-err-check
swarm: always check err before http status in tests
2016-09-13 10:53:55 -07:00
Alexander Morozov
85c3b8c1b1 Merge pull request #26433 from Microsoft/jjh/fix24819
Windows: Fix regression pulling linux images
2016-09-13 08:35:38 -07:00
Brian Goff
fc7b904dce Add new HostConfig field, Mounts.
`Mounts` allows users to specify in a much safer way the volumes they
want to use in the container.
This replaces `Binds` and `Volumes`, which both still exist, but
`Mounts` and `Binds`/`Volumes` are exclussive.
The CLI will continue to use `Binds` and `Volumes` due to concerns with
parsing the volume specs on the client side and cross-platform support
(for now).

The new API follows exactly the services mount API.

Example usage of `Mounts`:

```
$ curl -XPOST localhost:2375/containers/create -d '{
  "Image": "alpine:latest",
  "HostConfig": {
    "Mounts": [{
      "Type": "Volume",
      "Target": "/foo"
      },{
      "Type": "bind",
      "Source": "/var/run/docker.sock",
      "Target": "/var/run/docker.sock",
      },{
      "Type": "volume",
      "Name": "important_data",
      "Target": "/var/data",
      "ReadOnly": true,
      "VolumeOptions": {
	"DriverConfig": {
	  Name: "awesomeStorage",
	  Options: {"size": "10m"},
	  Labels: {"some":"label"}
	}
      }]
    }
}'
```

There are currently 2 types of mounts:

  - **bind**: Paths on the host that get mounted into the
    container. Paths must exist prior to creating the container.
  - **volume**: Volumes that persist after the
    container is removed.

Not all fields are available in each type, and validation is done to
ensure these fields aren't mixed up between types.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-09-13 09:55:35 -04:00
Alexander Morozov
036a8f77b0 Merge pull request #26461 from crosbymichael/term-exec
Add TERM env var to exec
2016-09-12 14:57:37 -07:00
Tonis Tiigi
ed747e5a9e Fix already loaded detection for frozen images
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-09-12 12:55:26 -07:00
Christy Perez
3dea5dbb9a Always check err before http status
A test failed expecting 200, but received -1, which is an err rc,
not an HTTP status code, so move these checks up.

Also log the output an not just check for a nil err.

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
2016-09-12 12:45:08 -05:00
Michael Crosby
4633f15f13 Add TERM env var to exec
When the `-t` flag is passed on exec make sure to add the TERM env var
to mirror the expected configuration from run.

Fixes #9299

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-12 09:20:27 -07:00
Akihiro Suda
e03cc68e3a test: fix trivial code convention noncompliance
daemon/events/testutils: rename eventstestutils to testutils
volume/testutils: rename volumetestutils to testutils

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-12 07:36:52 +00:00
John Howard
8437d0a329 Windows: Fix regression pulling linux images
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-09 11:40:34 -07:00
Phil Estes
cf58eb437c Merge pull request #22049 from boucher/docker-checkpoint-restore
Implement containerd API for checkpoints
2016-09-09 13:36:55 -04:00
Phil Estes
6062ae5742
Remove --read-only restriction when user ns enabled
The restriction is no longer necessary given changes at the runc layer
related to mount options of the rootfs. Also cleaned up the docs on
restrictions left for userns enabled mode. Re-enabled tests related to
--read-only when testing a userns-enabled daemon in integration-cli.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2016-09-09 13:23:41 -04:00
Michael Crosby
c1f2776bf1 Merge pull request #26428 from darrenstahlmsft/AddToSymlink
Don't attempt to evaluate drive root on Windows
2016-09-09 09:09:24 -07:00
boucher
d8fef66b03 Initial implementation of containerd Checkpoint API.
Signed-off-by: boucher <rboucher@gmail.com>
2016-09-08 21:31:52 -04:00
Stephen J Day
8e5ef8af5c
client: don't hide context errors
Instead of reformatting error from the request action, we wrap it,
allowing the cause to be recovered. This is important for consumers that
need to be able to detect context errors, such as `Cancelled` and
`DeadlineExceeded`.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-09-08 17:47:43 -07:00
Darren Stahl
fdce2a7775 Don't attempt to evaluate drive root on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-09-08 13:52:54 -07:00
Michael Crosby
4e2d442901 Merge pull request #26119 from cpuguy83/lazily_load_fixtures
Move some test fixtures to go
2016-09-08 11:16:27 -07:00
Brian Goff
ba07661f0d Merge pull request #26405 from yongtang/26326-inspect-ulimit-with-daemon-default
Fix Ulimits in `docker inspect` when daemon default exists
2016-09-08 13:21:26 -04:00
Madhu Venugopal
719a640743 Merge pull request #25962 from mrjana/net
Add support for docker run in swarm mode overlay
2016-09-08 09:39:00 -07:00
Yong Tang
7d705a7355 Fix ulimits in docker inspect when daemon default exists
This fix tries to fix 26326 where `docker inspect` will not show
ulimit even when daemon default ulimit has been set.

This fix merge the HostConfig's ulimit with daemon default in
`docker inspect`, so that when daemon is started with `default-ulimit`
and HostConfig's ulimit is not set, `docker inspect` will output
the daemon default.

An integration test has been added to cover the changes.

This fix fixes 26326.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-07 23:15:22 -07:00
Jana Radhakrishnan
99a98ccc14 Add support for docker run in swarm mode overlay
This PR adds support for running regular containers to be connected to
swarm mode multi-host network so that:
    - containers connected to the same network across the cluster can
      discover and connect to each other.
    - Get access to services(and their associated loadbalancers)
      connected to the same network

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-07 21:20:41 -07:00
John Howard
52f0474851 Windows: docker top implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-07 16:29:02 -07:00
Brian Goff
ff91276d1f Move some test fixtures to go
moves ensure-frozen-images to go
moves ensure-syscall-test to go
moves ensure-nnp-test to go
moves ensure-httpserver to go

Also makes some of the fixtures load only for the required tests.
This makes sure that fixtures that won't be needed for a test run such as
`make TESTFLAGS='-check.f Swarm' test-integration-cli` (for example)
aren't loaded... like the syscall tests.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-09-07 17:30:35 -04:00
Michael Crosby
91e197d614 Add engine-api types to docker
This moves the types for the `engine-api` repo to the existing types
package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-07 11:05:58 -07:00
Tõnis Tiigi
a6daa94e3e Merge pull request #26342 from cpuguy83/20079_restore_volume_migrate
restore migrating pre-1.7.0 volumes
2016-09-07 10:56:07 -07:00
Aaron Lehmann
86124ca04b Merge pull request #23100 from runcom/fix-stores
support legacy registries in exernal stores
2016-09-07 09:44:41 -07:00
Brian Goff
6168e98a13 Merge pull request #26115 from yongtang/08292016-info-registry-mirrors
Add registry mirrors information in the output of `docker info`
2016-09-07 11:37:36 -04:00
Vincent Demeester
a51fcc26fa Merge pull request #26352 from Microsoft/jjh/volumenocopydata
Windows: Correct TestVolumesNoCopyData
2016-09-07 11:23:10 +02:00
Antonio Murdaca
67d752ac55
support legacy registries in exernal stores
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-09-07 09:45:42 +02:00
John Howard
8a1fdce7fe Windows: Correct TestVolumesNoCopyData
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-06 15:38:19 -07:00
Christopher Jones
42f3865d24
Integration-cli: change daemon id generation
Fixes #24805

Changes test daemon id generation from using time.Now().UnixNano() to using
stringid. This is because of a go bug (fixed upstream for 1.8) on ppc64le
and s390x where time.Now().UnixNano() would not return nanosecond precision,
so initializing consecutive daemons sometimes would result in them having
the same id.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-09-06 18:17:24 -04:00
Brian Goff
dc712b9249 restore migrating pre-1.7.0 volumes
This was removed in a clean-up
(060f4ae617) but should not have been.
Fixes issues with volumes when upgrading from pre-1.7.0 daemons.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-09-06 17:17:47 -04:00
Antonis Kalipetis
c6bff578b4
Add test for checking created directories on remapped root
Signed-off-by: Antonis Kalipetis <akalipetis@gmail.com>
2016-09-05 13:02:13 +03:00
Yong Tang
83d79f13aa Fix issue in disconnecting a container from network
This fix tries to address the issue raised in 26220 where
disconnecting a container from network does not work if
the network id (instead of network name) has been specified.

The issue was that internally when trying to disconnecting
a contaienr fromt the network, the originally passed network
name or id has been used.

This fix uses the resolved network name (e.g., `bridge`).

An integration test has been added to cover the changes.

This fix fixes 26220.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-04 07:28:45 -07:00
Vincent Demeester
c73fae2352 Merge pull request #26290 from tonistiigi/govet17
Fix govet for go1.7
2016-09-03 19:27:19 +02:00
Tonis Tiigi
7a8c7b47cf Fix govet for go1.7
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-09-02 19:07:54 -07:00
Daniel Nephin
2e0bc0393a Merge pull request #26225 from yongtang/26173-docker-import-quoted-change
Fix issue in `docker import -c` with quoted flags
2016-09-02 13:34:25 -04:00
Brian Goff
84ebbb5231 Merge pull request #26261 from Microsoft/jjh/morebuildtests
Windows CI: Enable some more build tests
2016-09-02 09:41:08 -04:00
Justin Cormack
9d71cba5f0 Merge pull request #24510 from runcom/new-seccomp-format
New seccomp json format
2016-09-02 09:14:01 +01:00
Yong Tang
a79a27412d Fix issue in docker import -c with quoted flags
This fix tries to address the issue in 26173 where `docker import -c`
with quoted flags returns an error.

The issue was that in `api/client/image/import.go` the flag
`--change/-c` was handled by `StringSliceVarP` which does not handle
the quote well.

The similiar issue was enountered for 23309 (`docker commit`).

This fix takes the same approach as 23309 where `StringSliceVarP`
was replaced with `VarP` and `opts.ListOpts`.

An integration test has been added to cover the changes.

This fix fixes 26173.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-01 16:28:22 -07:00
John Howard
ede6163ec6 Windows CI: Enable some more build tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-01 16:27:04 -07:00
Derek McGowan
3f5392fdda
Update token server error test to not fail on retries
Instead of having the misconfigured token server test
fail after maxing out retries, only retry a few times
then return an error which will not retry.

Referenced by #19425

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-09-01 15:18:15 -07:00
Vincent Demeester
a19bdec6f0 Merge pull request #26172 from Microsoft/jjh/testinspect
Windows: Enable multiple TestInspect tests
2016-09-01 19:46:19 +02:00
Tõnis Tiigi
83fc63f967 Merge pull request #26077 from runcom/fix-TestImportBadURL
integration-cli: fix TestImportBadURL w/o network
2016-09-01 09:30:02 -07:00
Vincent Demeester
8abaf62715 Merge pull request #26226 from YuPengZTE/devTest
The first letter should be small in errors.New
2016-09-01 17:28:32 +02:00
Antonio Murdaca
5ff21add06
New seccomp format
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-09-01 11:53:07 +02:00
Justin Cormack
8ccac1ad4d Merge pull request #26200 from runcom/engine-api-vendor
vendor docker/engine-api@f9cef59044
2016-09-01 10:51:34 +01:00
Vincent Demeester
f173555de8 Merge pull request #26180 from yongtang/25943-validate-ip6
Fix issue in `--ip6` validation for `docker create`
2016-09-01 11:02:16 +02:00
Vincent Demeester
b8d510e86a Merge pull request #26181 from yongtang/08302016-DockerDaemonSuite-NewDaemon
Change related test from DockerSuite to DockerDaemonSuite in `docker_cli_daemon_test.go`
2016-09-01 09:42:59 +02:00
YuPengZTE
e7935da239 The first letter should be small in errors.New
Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
2016-09-01 11:26:40 +08:00
Arnaud Porterie
5a56f29c64 Merge pull request #26208 from talex5/fix-health-test
Fix exec form of HEALTHCHECK CMD
2016-08-31 23:27:39 +00:00
Antonio Murdaca
8f7a8c75ae
vendor docker/engine-api@f9cef59044
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-08-31 22:39:13 +02:00
Tonis Tiigi
f0e9997287 Revert "Change related tests from DockerSuite to DockerDaemonSuite in docker_cli_info_test.go"
This reverts commit 0ce5ef279c.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-08-31 11:52:22 -07:00
Thomas Leonard
e95b6b51da Fix exec form of HEALTHCHECK CMD
We attached the JSON flag to the wrong AST node, causing Docker to treat
the exec form ["binary", "arg"] as if the shell form "binary arg" had
been used. This failed if "ls" was not present.

Added a test to detect this.

Fixes #26174

Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
2016-08-31 17:50:12 +01:00
John Howard
3ae6cd453e Windows: Enable multiple TestInspect tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-31 08:12:50 -07:00
Yong Tang
1e6eccae69 Fix issue in --ip6 validation for docker create
This fix tries to address the issue raised in comment:
https://github.com/docker/docker/pull/25943#discussion_r76843081
Previously, the validation for `ip6` is done by checking ParseIP().To16().
However, in case an IPv4 address or an IPv4-mapped Ipv6 address has been
provided, the validation will pass (should fail).

This fix first check if `--ip6` is passed with a valid IP address and returns
error for invalid IP addresses. It then check if an IPv4 or IPv4-mapped Ipv6
address is passed, and return error accordingly.

This fix adds two more cases in the tests. One for IPv4 address passed to `--ip6`
and another for Ipv4-mapped IPv6 address passed to `--ip6`. In both cases,
without this fix the validation will pass through.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-30 19:28:44 -07:00
Yong Tang
5c0fd2d06e Change related test from DockerSuite to DockerDaemonSuite in docker_cli_daemon_test.go
This fix is a follow-up of 26154. I did a grep on `integration-cli` and
found out that there are several tests in `docker_cli_daemon_test.go`
that still use `NewDaemon` instread of `DockerDaemonSuite`.

This fix changes related tests from DockerSuite to DockerDaemonSuite in
`docker_cli_daemon_test.go`.

With this fix, now `NewDaemon` is only called from `SetUpTest` on
various DockerXXXSuite. That should help maintain the test code base.

This fix is related to the comments in:
26115
24533.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-30 18:30:27 -07:00
Tõnis Tiigi
fbcf0a50b2 Merge pull request #26170 from Microsoft/jjh/testimages
Windows: Enable TestImage and TestImport tests
2016-08-30 17:52:50 -07:00
Tõnis Tiigi
b26059a0ca Merge pull request #26166 from Microsoft/jjh/testhelp
Windows: Enable TestHelpExitCodesHelpOutput
2016-08-30 17:50:52 -07:00
Tõnis Tiigi
4d15f428b1 Merge pull request #26165 from Microsoft/jjh/testexec
Windows: Enable a couple of exec tests
2016-08-30 17:50:25 -07:00
Tõnis Tiigi
75dc3614f7 Merge pull request #26164 from Microsoft/jjh/testcreate
Windows: Enable some create CI tests
2016-08-30 17:49:57 -07:00
Tõnis Tiigi
5d5d80ca69 Merge pull request #26163 from Microsoft/jjh/testcp
Windows: Enable some cp integration tests
2016-08-30 17:49:26 -07:00
Tõnis Tiigi
69f25f9da8 Merge pull request #26161 from Microsoft/jjh/testcontainerapi
Windows: Port api_containers_test tests
2016-08-30 17:48:43 -07:00
Alexander Morozov
399761af4d Merge pull request #26154 from yongtang/08302016-docker-cli-info-test-DockerDaemonSuite
Change related tests from DockerSuite to DockerDaemonSuite in `docker_cli_info_test.go`
2016-08-30 16:56:00 -07:00
John Howard
7ea707d5ef Windows: Enable TestImage and TestImport tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-30 15:20:55 -07:00
John Howard
f93f692e51 Windows: Enable TestHelpExitCodesHelpOutput
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-30 15:05:02 -07:00
John Howard
ea42182722 Windows: Enable a couple of exec tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-30 15:03:18 -07:00
John Howard
78aede292b Windows: Enable some create CI tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-30 14:38:19 -07:00
John Howard
088c3eeea8 Windows: Enable some cp integration tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-30 14:32:10 -07:00
Kenfe-Mickael Laventure
88bfa6ede8 Add integration test to check persistence of exitcode and error message
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-08-30 14:17:09 -07:00
John Howard
3d5aac305f Windows: Port api_containers_test tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-30 14:15:33 -07:00
Vincent Demeester
73614f9f1e Merge pull request #26020 from tonistiigi/fix-eventsbefore-test
Fix flaky TestEventsContainerFilterBeforeCreate
2016-08-30 22:24:52 +02:00
Vincent Demeester
cf3e834c9b Merge pull request #26153 from Microsoft/jjh/testcommitcli
Windows: Enable some commit tests
2016-08-30 22:17:20 +02:00
Vincent Demeester
8a46c18dd4 Merge pull request #26147 from Microsoft/jjh/testbuildapi
Windows: Enable 5 Build API tests
2016-08-30 22:12:36 +02:00
Vincent Demeester
16148d0420 Merge pull request #26149 from Microsoft/jjh/testbuildcli
Windows: Enable multiple cli build tests
2016-08-30 22:12:24 +02:00
Yong Tang
0ce5ef279c Change related tests from DockerSuite to DockerDaemonSuite in docker_cli_info_test.go
This fix changes related tests from DockerSuite to DockerDaemonSuite
in `docker_cli_info_test.go`. Previously that was done through `NewDaemon()`.

This fix is related to the comments in:
https://github.com/docker/docker/pull/26115#discussion_r76784977
https://github.com/docker/docker/pull/24533#issuecomment-243420042

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-30 10:11:01 -07:00
John Howard
bb4b31585c Windows: Enable multiple cli build tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-30 09:51:13 -07:00
John Howard
ac59dfa761 Windows: Enable some commit tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-30 09:48:18 -07:00
John Howard
a06c695177 Windows: Enable docker_cli_history_test
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-30 09:31:33 -07:00
Yong Tang
0f6acff796 Add registry mirrors information in the output of docker info
This fix tries to add the registry mirrors information in the output
of `docker info`.

In our active deployment, we use registry mirrors to help speeding
up the `docker pull`. In the current output of `docker info`,
registry mirrors is not present though it is available in `/info` API.

I think it makes sense to add the registry mirrors to `docker info`,
similiar to insecure registries.

This fix adds the registry mirrors to the output of `docker info`:
```
Registry Mirrors:
 https://192.168.1.2/
 http://registry.mirror.com:5000/
```

An integration test has been added to cover the changes.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-30 09:05:24 -07:00
John Howard
8bc1c9c08a Windows: Enable 5 Build API tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-30 08:41:17 -07:00
Brian Goff
edafc642b2 Merge pull request #25890 from cpuguy83/fix_swarm_control_sock_path
Use daemon exec root for swarm control socket
2016-08-30 08:51:52 -04:00
Yong Tang
80e3975117 Fix issue in API POST /services/(id or name)/update
This fix tries to address the issue raised in 26090 where
remote API `POST /services/(id or name)/update` cannot
use `name` to update. This is not consistent with the
documentation of the remote API.

This fix fixes this issue by performing a lookup with `getService`
in case `name` instead of `id` is used in API.

This fix adds an integration test to cover the changes.

This fix fixes 26090.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-29 21:13:53 -07:00
John Howard
934fe3f73e Windows: Enable 2 TestAttach* tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-29 15:57:27 -07:00
Brian Goff
d09c04a667 Merge pull request #25317 from yongtang/25304-docker-service-create-group
Support `--group` in `docker service create`
2016-08-29 10:27:31 -04:00
Vincent Demeester
bf0077c138 Merge pull request #25990 from vieux/plugin_inspect
add -f to plugin inspect
2016-08-28 17:03:40 +02:00
Arnaud Porterie
9ea28ea894 Merge pull request #26055 from mavenugo/ndn
Support container disconnect for non-existing network
2016-08-28 01:48:02 +00:00
Antonio Murdaca
e2be3fee02
integration-cli: fix TestImportBadURL w/o network
As explained in the test comment itself, the error message may vary on
different platform.
This patch adds another condition found while testing w/o network
access on RHEL based distros (Fedora, RHEL, CentOS).

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-08-27 23:57:54 +02:00
Yong Tang
b31969ee36 Support --group-add and --group-rm in docker service create/update
This fix tries to address the issue raised in 25304 to support
`--group-add` and `--group-rm` in `docker service create`.

This fix adds `--group-add` to `docker service create` and `docker service update`,
adds `--group-rm` to `docker service update`.

This fix updates docs for `docker service create` and `docker service update`:
1. Add `--group-add` to `docker service create` and `docker service update`
2. Add `--group-rm` to `docker service update`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-27 11:54:05 -07:00
Madhu Venugopal
05a3f2666e Support container disconnect for non-existing network
There are cases such as migrating from classic overlay network to the
swarm-mode networking (without kv-store), such a mechanism to allow
disconnecting a container even when a network isnt available will be
useful.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-08-26 16:48:52 -07:00
Tibor Vass
ed0dff8f16 Merge pull request #25424 from vieux/enabled
replace active by enabled for consistency in plugins
2016-08-26 15:22:41 -07:00
Alexander Morozov
bdadcfc1bb Merge pull request #25861 from WeiZhang555/wait-remove-for-start
Using waitExitOrRemoved for `docker start`
2016-08-26 13:36:56 -07:00
Vincent Demeester
5168c93419 Merge pull request #23830 from ardnaxelarak/23345_remove_name_from_volume_create
remove --name flag from volume create
2016-08-26 21:52:07 +02:00
Arnaud Porterie
6e85b81df2 Merge pull request #23614 from icecrime/inspect_services
Allow `docker inspect` on all types
2016-08-26 18:45:23 +00:00
Michael Crosby
175f6eb55f Merge pull request #25177 from cpuguy83/fix_TestDaemonDiscoveryBackendConfigReload
TestDaemonDiscoveryBackendConfigReload behavior
2016-08-26 10:54:48 -07:00
Brian Goff
20f99a8634 TestDaemonDiscoveryBackendConfigReload behavior
`TestDaemonDiscoveryBackendConfigReload` was doing some wierd things
with files, creating a file (directly in `./integration-cli`), removing
it, then creating a new file.
This is just weird, so fixed it to use a single file, file will go into
a temp dir so it doesn't pollute integration-cli.

It was also blindly sending a SIGHUP to the daemon process then sleeping
for 3 seconds.  This is racey, and slow.
Change this to look for the daemon-reload event in the event stream.
Reload logic is moved to a separate function and blocks (w/ a timeout)
waiting for the reload event to fire.

Runtime of the test is now ~0.5s on my machine, where as it was a
minimum of 3s due to the `time.Sleep` before.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-08-26 11:02:04 -04:00
Victor Vieux
63a19edcb1 add -f to plugin inspect
Signed-off-by: Victor Vieux <vieux@docker.com>

Signed-off-by: Victor Vieux <vieux@docker.com>
2016-08-25 22:40:05 -07:00
Yong Tang
c7045eb935 Validate --ip and --ip6 for docker create
This fix tries to fix the issue raised in 25863 where `--ip` value
is not validated for `docker create`. As a result, the IP address
passed by `--ip` is not used for `docker create` (ignored silently).

This fix adds validation in the daemon so that `--ip` and  `--ip6`
are properly validated for `docker create`.

An integration test has been added to cover the changes.

This fix fixes 25863.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-25 22:11:23 -07:00
Victor Vieux
cf4e268115 replace active by enabled for consistency in plugins
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-08-25 20:42:49 -07:00
Arnaud Porterie (icecrime)
3db9f7afce
Refactor docker inspect to work on all types
Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
2016-08-25 16:29:08 -07:00
Kara Alexandra
ba3f0bf0e7 Add option to specify name without --name in volume create
Signed-off-by: Kara Alexandra <kalexandra@us.ibm.com>
2016-08-25 14:20:06 -07:00
Daniel Nephin
25587906d1 Merge pull request #25354 from dnephin/remove-mflag-from-dockerd
Convert docker and dockerd commands to spf13/cobra
2016-08-25 17:19:19 -04:00
Alexander Morozov
8d99dfbc69 Merge pull request #25978 from justincormack/no-no-gccgo
Remove gccgo support
2016-08-25 12:12:29 -07:00
Tonis Tiigi
e372883fcd Fix flaky TestEventsContainerFilterBeforeCreate
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-08-25 10:29:10 -07:00
Daniel Nephin
6e7405ebd4 Fix tests and windows service.
Support args to RunCommand
Fix docker help text test.
Fix for ipv6 tests.
Fix TLSverify option.
Fix TestDaemonDiscoveryBackendConfigReload
Use tempfile for another test.
Restore missing flag.
Fix tests for removal of shlex.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:36 -04:00
Vincent Demeester
0c6926070f Merge pull request #25816 from anusha-ragunathan/vol-plugin-list
Make `docker volume list` lookup plugins installed using new model.
2016-08-25 19:02:25 +02:00
Zhang Wei
b8464c1c9b Using waitExitOrRemoved for docker start
Currently start command will invoke getExitCode - which is based on
Inspect API - to get returned exit code after container exits.
There's two race conditions here:

if container is started with Restart Policy, there's chance that the
container is restarted quickly before it calls getExitCode, under such
circumstance, the exit code is wrong.

if container is started with --rm, it's possible that container is
removed before getExitCode, in this situation, you can't get correct
exit code either.

Replace getExitCode with waitExitOrRemoved can solve this problem.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-26 00:16:49 +08:00
Vincent Demeester
d13ad3ef76 Merge pull request #24073 from johnharris85/move-restart-policy-check-to-daemon
Move restart-policy validation from client to daemon.
2016-08-25 17:02:30 +02:00
Daniel Nephin
b29558ed5d Merge pull request #25426 from dnephin/better-int-testing-cmd
Remove duplicate RunCommand functions used for integration-cli
2016-08-24 11:34:24 -04:00
Justin Cormack
eda90f6344 Remove gccgo support
Since Go 1.7, s390x uses upstream Go, so we have no reason to
support gccgo any more.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-08-24 11:09:35 +01:00
Justin Cormack
fe125adb0f Merge pull request #25905 from yongtang/25000-docker-stats-NetworkDisabled
Fix issue in `docker stats` with `NetworkDisabled=true`
2016-08-24 10:53:56 +01:00
Yong Tang
9cb8fb6ea0 Fix AuthZ plugins headers change issue
This fix tries to address the issue raised in 25927 where
the HTTP headers have been chaged when AUthZ plugin is in
place.

This issue is that in `FlushAll` (`pkg/authorization/response.go`),
the headers have been written (with `WriteHeader`) before all the
headers have bee copied.

This fix fixes the issue by placing `WriteHeader` after.

A test has been added to cover the changes.`

This fix fixes 25927

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-23 21:08:23 -07:00
Yong Tang
7bb9c5397e Fix issue in docker stats with NetworkDisabled=true
This fix tries to address the issue in 25000 where `docker stats`
will not show network stats with `NetworkDisabled=true`.

The `NetworkDisabled=true` could be either invoked through
remote API, or through `docker daemon -b none`.

The issue was that when `NetworkDisabled=true` either by API or
by daemon config, there is no SandboxKey for container so an error
will be returned.

This fix fixes this issue by skipping obtaining SandboxKey if
`NetworkDisabled=true`.

Additional test has bee added to cover the changes.

This fix fixes 25000.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-23 16:04:06 -07:00
Daniel Nephin
243885808f Change to use c.Assert() instead of result.Assert()
Fix delete containers and make sure it prints errors correctly.
Rename Result.Fails to Result.Assert()
Create a constant for the default expected.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-23 15:12:36 -04:00
Daniel Nephin
d7022f2b46 Create a unified RunCommand function with Assert()
Remove some run functions and replace them with the unified run command.
Remove DockerCmdWithStdoutStderr
Remove many duplicate runCommand functions.
Also add dockerCmdWithResult()
Allow Result.Assert() to ignore the error message if an exit status is expected.
Fix race in DockerSuite.TestDockerInspectMultipleNetwork
Fix flaky test DockerSuite.TestRunInteractiveWithRestartPolicy

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-23 15:11:46 -04:00
Daniel Nephin
fb42e84772 Remove unnecessary json.Unmarshal wrapper.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-23 15:11:46 -04:00
Vincent Demeester
b97f985054 Merge pull request #25939 from YuPengZTE/printf
It is better to add "\n" in printf
2016-08-23 10:26:54 +02:00
YuPengZTE
9b015bd4fd It is better to add "\n" in printf
Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
2016-08-23 09:01:25 +08:00
Tonis Tiigi
96a27cf093 Update executor changes from swarmkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-08-22 11:36:20 -07:00
Brian Goff
4d95ea319c Use daemon exec root for swarm control socket
Right now docker puts swarm's control socket into the docker root dir
(e.g. /var/lib/docker).
This can cause some nasty issues with path length being > 108
characters, especially in our CI environment.

Since we already have some other state going in the daemon's exec root
(libcontainerd and libnetwork), I think it makes sense to move the
control socket to this location, especially since there are other unix
sockets being created here by docker so it must always be at a path that
works.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-08-19 16:43:57 -04:00
Vincent Demeester
09b929083d Merge pull request #23436 from yongtang/23367-out-of-band-volume-driver-deletion
Add `--force` in `docker volume rm` to fix out-of-band volume driver deletion
2016-08-19 22:09:57 +02:00
Sebastiaan van Stijn
ec8f20cbf2 Merge pull request #25665 from vdemeester/remove-deprecated-run-flag-from-commit
Remove -run flag from commit command.
2016-08-19 15:19:23 +02:00
Vincent Demeester
54ed156879
Remove -run flag from commit command.
This flag has been deprecated in version below 1.10 so it's safe to
remove now, according to our deprecation policy.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-08-19 13:14:03 +02:00
Yong Tang
6c5c34d50d Add --force in docker volume rm to fix out-of-band volume driver deletion
This fix tries to address the issue in raised #23367 where an out-of-band
volume driver deletion leaves some data in docker. This prevent the
reuse of deleted volume names (by out-of-band volume driver like flocker).

This fix adds a `--force` field in `docker volume rm` to forcefully purge
the data of the volume that has already been deleted.

Related documentations have been updated.

This fix is tested manually with flocker, as is specified in #23367.
An integration test has also been added for the scenario described.

This fix fixes #23367.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-18 18:01:25 -07:00
Doug Davis
282b0aff08 Merge pull request #24978 from yongtang/24912-build-with-progress
Add hint of progress to the output of `docker build`
2016-08-18 16:10:48 -04:00
Alexander Morozov
a1fece6821 Merge pull request #25808 from justincormack/parallel-tests
Run seccomp tests in series not parallel
2016-08-17 14:50:24 -07:00
Anusha Ragunathan
59c45f7c0a Make docker volume list lookup plugins installed using new model.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-08-17 13:27:43 -07:00
Justin Cormack
84ec04306c Run seccomp tests in series not parallel
Fix #24803 as this had been failing sometimes.

As the parallel tests are probably genuine failures, and
had already been cut down, I will re-create these specifically
as a parallel execution test with no seccomp to make the
cause clearer.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-08-17 18:48:06 +01:00