Commit graph

3926 commits

Author SHA1 Message Date
Sebastiaan van Stijn
8233e2b54d Merge pull request #25461 from coolljt0725/fix_update_mem
Fix update memory without memoryswap
2016-08-09 16:02:55 +02:00
yuexiao-wang
5882a9ea17 add more info for debugging
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-08-09 17:06:44 +08:00
Zhang Wei
da6609ccdc Fix typo
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-09 09:42:23 +08:00
Zhang Wei
6dd8e10d6e Wait container's removal via Events API
If AutoRemove is set, wait until client get `destroy` events, or get
`detach` events that implies container is detached but not stopped.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-08 22:46:53 +08:00
Zhang Wei
3c2886d8a4 Move --rm to daemon side
`--rm` is a client side flag which caused lots of problems:
1. if client lost connection to daemon, including client crash or be
killed, there's no way to clean garbage container.
2. if docker stop a `--rm` container, this container won't be
autoremoved.
3. if docker daemon restart, container is also left over.
4. bug: `docker run --rm busybox fakecmd` will exit without cleanup.

In a word, client side `--rm` flag isn't sufficient for garbage
collection. Move the `--rm` flag to daemon will be more reasonable.

What this commit do is:
1. implement a `--rm` on daemon side, adding one flag `AutoRemove` into
HostConfig.
2. Allow `run --rm -d`, no conflicting `--rm` and `-d` any more,
auto-remove can work on detach mode.
3. `docker restart` a `--rm` container will succeed, the container won't
be autoremoved.

This commit will help a lot for daemon to do garbage collection for
temporary containers.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-08 22:46:53 +08:00
Sebastiaan van Stijn
2684459ed4 Merge pull request #23718 from yongtang/23498-entrypoint-unset
Allow unset `--entrypoint` in `docker run` or `docker create`
2016-08-08 14:38:01 +02:00
Lei Jitang
92394785fa Fix update memory without memoryswap
The memory should always be smaller than memoryswap,
we should error out with message that user know how
to do rather than just an invalid argument error if
user update the memory limit bigger than already set
memory swap.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-08-08 18:36:03 +08:00
yuexiao-wang
256310e962 close pipe after using pipe
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-08-08 15:16:01 +08:00
yuexiao-wang
427869fe94 modify func namt from TestUserAgentPassThroughOnPull to TestUserAgentPassThrough
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-08-08 11:40:20 +08:00
johnharris85
94e95e4711 Move restart-policy validation from client to daemon.
Signed-off-by: John Harris <john@johnharris.io>
2016-08-06 20:09:47 -07:00
Yong Tang
c8d3ee8093 Allow unset --entrypoint in docker run or docker create
This fix tries to address the issue raised in #23498 to allow unset
`--entrypoint` in `docker run` or `docker create`.

This fix checks the flag `--entrypoint` and, in case `--entrypoint=` (`""`)
is passed, unset the Entrypoint during the container run.

Additional integration tests have been created to cover changes in this fix.

This fix fixes #23498.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-05 16:35:20 -07:00
Tõnis Tiigi
4c528ae719 Merge pull request #25402 from lixiaobing10051267/masterChmod
Fatal info not identical with actual chmod intent
2016-08-05 08:42:30 -07:00
Vincent Demeester
1ccd9d3137 Merge pull request #23475 from vdemeester/add-format-flag-to-network-and-volume-ls
Add format flag to network and volume ls
2016-08-05 15:17:45 +02:00
Vincent Demeester
29fef34139 Merge pull request #25387 from yongtang/25374-ps-filter-order
Sort output of `docker ps --filter` with order by creation time
2016-08-05 14:47:10 +02:00
Vincent Demeester
85428a1a53 Merge pull request #25096 from vieux/docker_plugin_remove_force
Add --force to docker plugin remove
2016-08-05 14:45:05 +02:00
Vincent Demeester
f570fbb9ba Merge pull request #25401 from lixiaobing10051267/masterConfig
Docker api inspect assert HostConfig
2016-08-05 14:11:29 +02:00
Yong Tang
3f97133546 Sort output of docker ps --filter with order by creation time
This fix tries to address the issue raised in 25374 where the
output of `docker ps --filter` is in random order and
not deterministic.

This fix sorts the list of containers by creation time so that the
output is deterministic.

An integration test has been added.

This fix fixes 25374.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-04 19:27:50 -07:00
Victor Vieux
0016b331da Add --force to docker plugin remove
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-08-04 15:55:45 -07:00
Alexander Morozov
979d48bbf5 Merge pull request #23902 from dnephin/inspect-to-cobra
Convert inspect command to Cobra
2016-08-04 11:20:43 -07:00
Brian Goff
af51c9704c Merge pull request #25370 from thaJeztah/move-experimental-test
Move TestInspectNamedMountPoint integrationtest from experimental
2016-08-04 11:12:46 -04:00
lixiaobing10051267
86c72aa01f Docker api inspect Assert HostConfig
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-08-04 23:01:16 +08:00
Vincent Demeester
a488ad1a09
Add volume --format flag to ls
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-08-04 14:59:55 +02:00
Vincent Demeester
a8aaafc4a3
Add network --format flag to ls
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-08-04 14:59:51 +02:00
lixiaobing10051267
bd0ec7ed55 Fatal info not identical with actual chmod intent
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-08-04 20:14:15 +08:00
Michael Crosby
94b1bb82e1 Decrease sleep to 2 seconds
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-08-03 15:25:27 -07:00
Michael Crosby
cfde8e7855 Change number of pings to 1
This cuts the test time down from 6s to 2s

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-08-03 13:30:34 -07:00
Michael Crosby
2f3b7f08a0 Make network stats version test concurrent
This change makes the test run go down from 10s to 2s

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-08-03 13:24:55 -07:00
Michael Crosby
3ffa5f6149 Remove build 60 steps
This test is already covered in the individual graph driver tests and it
adds 15s to the test run without adding value.  The original idea was to
test max number of layers, this is fulfilled by the graph drivers.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-08-03 13:16:01 -07:00
Daniel Nephin
fab2a3dc82 Ignore 'not a swarm error' when inspecting a task.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-03 12:22:07 -04:00
Sebastiaan van Stijn
6f2e820502
Move TestInspectNamedMountPoint integrationtest from experimental
This feature is no longer experimental, and should
now work on Windows too

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-03 16:21:38 +02:00
Vincent Demeester
4a94a6513b Merge pull request #25341 from tonistiigi/fix-pending-tests
Fix swarm pending state tests
2016-08-03 16:12:43 +02:00
Sebastiaan van Stijn
10ae908bfa Merge pull request #25159 from diogomonica/adding-force-to-node-remove
Adding force to node rm
2016-08-02 22:49:15 +02:00
Tonis Tiigi
fa3b5964b9 Fix swarm pending state tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-08-02 11:39:05 -07:00
Alexander Morozov
c73b054ae3 Merge pull request #25300 from duglin/FixEnv
Don't allow empty env names
2016-08-02 09:45:28 -07:00
Qiang Huang
da5d66fb70 Fix TestUpdateKernelMemoryUninitialized on new kernel version
Fixes: #25073

Update kernel memory on running containers without initialized
is forbidden only on kernel version older than 4.6.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-08-02 13:17:20 +08:00
Diogo Monica
a327c231b5 Add --force to node removal
Signed-off-by: Diogo Monica <diogo.monica@gmail.com>
2016-08-01 18:55:58 -07:00
Aaron Lehmann
f35c4343f3 Merge pull request #24878 from dongluochen/swarmConstraintTest
Add integration test for constraints
2016-08-01 17:45:23 -06:00
Sebastiaan van Stijn
f23c3a1263 Merge pull request #25171 from cpuguy83/23545_test_sockets_in_separate_dir
Use temp dir for integration daemon sockets
2016-08-02 01:21:22 +02:00
Alexander Morozov
415c0f12d2 Merge pull request #24947 from dnephin/integration-remove-cmdwithargs
Remove CmdWithArgs from integration-cli
2016-08-01 14:56:08 -07:00
Tibor Vass
3c46c3481f Merge pull request #25187 from anusha-ragunathan/plugin-delete
Remove plugin root from filesystem.
2016-08-01 14:33:30 -07:00
Anusha Ragunathan
5690730a74 Remove plugin root from filesystem.
`docker plugin remove` didnt actually remove plugin from disk. Fix that.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-08-01 10:46:50 -07:00
Doug Davis
e72c0137af Don't allow empty env names
Closes: #25281

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-08-01 10:25:51 -07:00
Vincent Demeester
2b90eaa596 Merge pull request #25258 from yongtang/24547-remove-require-network-from-swarm-tests
Remove testRequires(c, Network) from swarm integration tests
2016-08-01 13:33:36 +02:00
Sebastiaan van Stijn
b38c25ad41 Merge pull request #25224 from michael-holzheu/PR-TestRunSeccompUnconfinedCloneUserns-check
TestRunSeccompUnconfinedCloneUserns: Check for unprivileged_userns_clone
2016-07-31 17:03:36 +01:00
Yong Tang
85c9ef8a47 Remove testRequires(c, Network) from swarm integration tests
Since 24237 has been merged, it is not necessary to require network
for swarm integration tests (`integration-cli/docker_api_swarm_test.go`)
any more.

This fix removes testRequires(c, Network) from swarm integration
tests.

This fix could be verified by disable networking, and all related
tests pass.

This fix is related to 24547, 24490, 24237.

This fix fixes 24547.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-07-30 09:59:30 -07:00
Alexander Morozov
307b7b0d15 integration: drain node before stop in TestApiSwarmForceNewCluster
It's too long to wait for reschedule.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-07-29 10:44:30 -07:00
Brian Goff
10fcd30a90 Merge pull request #24020 from yongtang/23973-rename-with-linked-container
Fix docker rename with linked containers
2016-07-29 12:24:35 -04:00
Michael Holzheu
87e4e3af68 TestRunSeccompUnconfinedCloneUserns: Check for unprivileged_userns_clone
On Ubuntu and Debian there is a sysctl which allows to block
clone(CLONE_NEWUSER) via "sysctl kernel.unprivileged_userns_clone=0"
for unprivileged users that do not have CAP_SYS_ADMIN.

See: https://lists.ubuntu.com/archives/kernel-team/2016-January/067926.html

The DockerSuite.TestRunSeccompUnconfinedCloneUserns testcase fails if
"kernel.unprivileged_userns_clone" is set to 0:

 docker_cli_run_unix_test.go:1040:
    c.Fatalf("expected clone userns with --security-opt seccomp=unconfined
              to succeed, got %s: %v", out, err)
 ... Error: expected clone userns with --security-opt seccomp=unconfined
              to succeed, got clone failed: Operation not permitted
 : exit status 1

So add a check and skip the testcase if kernel.unprivileged_userns_clone is 0.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2016-07-29 12:16:03 -04:00
Vincent Demeester
3d42bf5f12 Merge pull request #23759 from AkihiroSuda/cobraexec
Migrate exec command to cobra
2016-07-29 07:41:02 +02:00
Akihiro Suda
9d9dff3d0d Migrate exec command to cobra
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-07-29 02:10:36 +00:00
Daniel Nephin
c0d2f7b338 Remove unnecessary CmdWithArgs
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-28 20:14:14 -04:00
Daniel Nephin
0ec20a3c01 Remove hack from test name.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-28 20:12:36 -04:00
Kenfe-Mickael Laventure
ff62681d59 Add live-restore state to daemon reload event
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-28 17:10:40 -07:00
Kenfe-Mickael Laventure
189aaf8aea Add live-restore state to docker info output
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-28 17:10:40 -07:00
Alexander Morozov
ca43efb40e Merge pull request #24502 from allencloud/change-comparison-log-in-container-config
update comparison log in container config
2016-07-28 16:51:11 -07:00
Michael Crosby
262063531a Merge pull request #25077 from cpuguy83/fix_TestApiSwarmRestartCluster
Fix race in `TestApiSwarmRestartCluster`
2016-07-28 10:15:31 -07:00
Brian Goff
4804eb700c Use temp dir for integration daemon sockets
Instead of using the bundles dir, which may be mounted in and ultimately
break if using b2d/d4mac/d4win. This makes it much easier to collect
test daemon logs and more natural for use d4mac/d4win users to run tests.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-28 12:53:56 -04:00
Sebastiaan van Stijn
8a8a63aa32 Merge pull request #25137 from justincormack/32bit-seccomp-test
Add a test that the default seccomp profile allows execution of 32 bit binaries
2016-07-28 17:01:04 +02:00
Sebastiaan van Stijn
1a7d339d36 Merge pull request #24816 from stevvooe/service-ps-over-tasks
cli: `docker service|node|stack ps` instead of tasks
2016-07-27 23:13:28 +02:00
Michael Crosby
297745b1cd Merge pull request #24760 from anusha-ragunathan/plugin-events
Make daemon events listen for plugin lifecycle events.
2016-07-27 13:36:49 -07:00
Stephen J Day
0aa4e1e689
cli: docker service|node|stack ps instead of tasks
Rather than conflict with the unexposed task model, change the names of
the object-oriented task display to `docker <object> ps`. The command
works identically to `docker service tasks`. This change is superficial.

This provides a more sensical docker experience while not trampling on
the task model that may be introduced as a top-level command at a later
date.

The following is an example of the display using `docker service ps`
with a service named `condescending_cori`:

```
$ docker service ps condescending_cori
ID                         NAME                  SERVICE             IMAGE   LAST STATE              DESIRED STATE  NODE
e2cd9vqb62qjk38lw65uoffd2  condescending_cori.1  condescending_cori  alpine  Running 13 minutes ago  Running        6c6d232a5d0e
```

The following shows the output for the node on which the command is
running:

```console
$ docker node ps self
ID                         NAME                  SERVICE             IMAGE   LAST STATE              DESIRED STATE  NODE
b1tpbi43k1ibevg2e94bmqo0s  mad_kalam.1           mad_kalam           apline  Accepted 2 seconds ago  Accepted       6c6d232a5d0e
e2cd9vqb62qjk38lw65uoffd2  condescending_cori.1  condescending_cori  alpine  Running 12 minutes ago  Running        6c6d232a5d0e
4x609m5o0qyn0kgpzvf0ad8x5  furious_davinci.1     furious_davinci     redis   Running 32 minutes ago  Running        6c6d232a5d0e
```

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-07-27 11:06:42 -07:00
Justin Cormack
93bbc76ee5 Add a test that the default seccomp profile allows execution of 32 bit binaries
While testing #24510 I noticed that 32 bit syscalls were incorrectly being
blocked and we did not have a test for this, so adding one.

This is only tested on amd64 as it is the only architecture that
reliably supports 32 bit code execution, others only do sometimes.

There is no 32 bit libc in the buildpack-deps so we cannot build
32 bit C code easily so use the simplest assembly program which
just calls the exit syscall.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-07-27 18:42:34 +01:00
Sebastiaan van Stijn
2c947a4b00 Merge pull request #25067 from lixiaobing10051267/masterBreak
Add break after found = true
2016-07-27 14:44:13 +02:00
Sebastiaan van Stijn
e07ff10f70 Merge pull request #25104 from cpuguy83/fix_TestApiSwarmRaftQuorum
fix race in TestApiSwarmRaftQuorum
2016-07-27 12:50:09 +02:00
Vincent Demeester
ef63637b99 Merge pull request #25107 from stevvooe/cleanup-leader-election-test
integration-cli: cleanup leader election tests
2016-07-27 12:47:33 +02:00
Brian Goff
5d65ba4ca7 Merge pull request #25085 from aaronlehmann/restart-delay-integration-tests
Specify a lower restart delay for swarm integration tests
2016-07-26 22:18:28 -04:00
Stephen J Day
946e23776b
integration-cli: cleanup leader election tests
Ensure convergence before moving on with testing leader election
conditions. This reduce the flakiness of this test when run in different
environments.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-07-26 19:12:27 -07:00
Brian Goff
4a856d7a87 fix race in TestApiSwarmRaftQuorum
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-26 21:32:56 -04:00
Aaron Lehmann
c93c649258 Specify a lower restart delay for swarm integration tests
If no restart delay is specified for a swarm service, the default
restart delay is 5 seconds. This is a reasonable value for actual
deployments - one example of where it's useful is that if a bad image is
specified, the orchestrator will wait 5 seconds between attempts to
restart it instead of restarting it in a tight loop.

In integration tests, this 5 second delay is dead time. The tests run
faster if the delay is reduced. Set it to 100 ms to avoid the waste of
time.

This appears to speed up a few tests:

DockerSwarmSuite.TestApiSwarmForceNewCluster 37.241s -> 34.323s
DockerSwarmSuite.TestApiSwarmRestartCluster  22.038s -> 15.545s
DockerSwarmSuite.TestApiSwarmServicesMultipleAgents 24.456s -> 19.853s
DockerSwarmSuite.TestApiSwarmServicesStateReporting 19.240s -> 10.049s

...a small step towards making the Swarm integration tests run in a
reasonable amount of time.

Also, change the update delay for the rolling update test from 8 seconds
to 4 seconds, which should be sufficient to differentiate between
batches of updated tasks. This reduces the runtime for
DockerSwarmSuite.TestApiSwarmServicesUpdate from 28s to 20s.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-26 12:12:43 -07:00
Yong Tang
63c0366bc9 Fix flaky TestSwarmNodeTaskListFilter by waiting for task fully deployed
This is an attempt to fix the flaky test of TestSwarmNodeTaskListFilter in 25029.

Basically this fix adds a check to wait until 3 containers has already up,
before processing `node tasks ...`.

This might fix 25029.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-07-26 11:56:58 -07:00
Brian Goff
fdcde8bb65 Fix race in TestApiSwarmRestartCluster
In `TestApiSwarmRestartCluster`, it's calling `checkClusterHealth`.
`checkClusterHealth` calls `d.info()`, which will return an error if
there is no cluster leader... problem is `checkClusterHealth` is doing a
nil error assertion w/o giving any time for a leader to be elected.

This moves the `d.info()` call into a `waitAndAssert` using the default
reconciliation timeout.

It also moves some other checks into a `waitAndAssert` to give the
cluster enough time to come back up.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-26 14:37:18 -04:00
Anusha Ragunathan
42abccb841 Make daemon events listen for plugin lifecycle events.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-07-26 10:51:47 -07:00
Sebastiaan van Stijn
3c4d3b2cac Merge pull request #25033 from anusha-ragunathan/plugin-restart
Check for plugin state before enabling plugin.
2016-07-26 18:24:02 +02:00
lixiaobing10051267
8928677ea2 Add break after found = true
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-07-26 23:28:44 +08:00
Vincent Demeester
e6923f6d75 Remove swarm inspect and use info instead
Remove the swarm inspect command and use docker info instead to display
swarm information if the current node is a manager.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-07-25 20:31:10 -07:00
Anusha Ragunathan
b867f6c6e1 Check for plugin state before enable and disable.
This prevents unnecessary API call to containerd.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-07-25 19:24:28 -07:00
Tibor Vass
afac3361dc Merge pull request #25023 from cpuguy83/25022_fix_label_panic
fix panic on --label-add
2016-07-25 18:13:15 -07:00
Brian Goff
a4634cd8a8 Merge pull request #24545 from runshenzhu/health-check
swarm: block controller.Start until container is healthy
2016-07-25 20:32:27 -04:00
Brian Goff
85bc3194aa fix panic on --label-add
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-25 19:20:44 -04:00
runshenzhu
a99db84b4a extend health check to start service
Signed-off-by: runshenzhu <runshen.zhu@gmail.com>
Signed-off-by: Runshen Zhu <runshen.zhu@gmail.com>
2016-07-25 15:49:22 -07:00
Vincent Demeester
8f11896a45 Merge pull request #24949 from Microsoft/jjh/tasklist-tlist
Windows: nanoserver TestBuildCmdShellArgsEscaped
2016-07-25 22:58:09 +02:00
Tibor Vass
c65925f24b Merge pull request #24943 from aaronlehmann/rolling-updates
Add failure action for rolling updates
2016-07-25 10:15:28 -07:00
Michael Crosby
b6197e9514 Merge pull request #24942 from anusha-ragunathan/plugin-liverestore
Handle plugin shutdown when liveRestore is set.
2016-07-25 09:49:34 -07:00
Aaron Lehmann
57ae29aa74 Add failure action for rolling updates
This changes the default behavior so that rolling updates will not
proceed once an updated task fails to start, or stops running during the
update. Users can use docker service inspect --pretty servicename to see
the update status, and if it pauses due to a failure, it will explain
that the update is paused, and show the task ID that caused it to pause.
It also shows the time since the update started.

A new --update-on-failure=(pause|continue) flag selects the
behavior. Pause means the update stops once a task fails, continue means
the old behavior of continuing the update anyway.

In the future this will be extended with additional behaviors like
automatic rollback, and flags controlling parameters like how many tasks
need to fail for the update to stop proceeding. This is a minimal
solution for 1.12.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-25 08:51:19 -07:00
Vincent Demeester
40044cb18f Merge pull request #24963 from allencloud/fix-typos
fix typos
2016-07-25 09:39:48 +02:00
Aaron Lehmann
a0ccd0d42f Split advertised address from listen address
There are currently problems with "swarm init" and "swarm join" when an
explicit --listen-addr flag is not provided. swarmkit defaults to
finding the IP address associated with the default route, and in cloud
setups this is often the wrong choice.

Introduce a notion of "advertised address", with the client flag
--advertise-addr, and the daemon flag --swarm-default-advertise-addr to
provide a default. The default listening address is now 0.0.0.0, but a
valid advertised address must be detected or specified.

If no explicit advertised address is specified, error out if there is
more than one usable candidate IP address on the system. This requires a
user to explicitly choose instead of letting swarmkit make the wrong
choice. For the purposes of this autodetection, we ignore certain
interfaces that are unlikely to be relevant (currently docker*).

The user is also required to choose a listen address on swarm init if
they specify an explicit advertise address that is a hostname or an IP
address that's not local to the system. This is a requirement for
overlay networking.

Also support specifying interface names to --listen-addr,
--advertise-addr, and the daemon flag --swarm-default-advertise-addr.
This will fail if the interface has multiple IP addresses (unless it has
a single IPv4 address and a single IPv6 address - then we resolve the
tie in favor of IPv4).

This change also exposes the node's externally-reachable address in
docker info, as requested by #24017.

Make corresponding API and CLI docs changes.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-24 09:23:07 -07:00
Yong Tang
35418c1455 Add hint of progress to the output of docker build
This fix tries to address the issue raised in 24912 where docker
build only consists of the current step without overall total steps.

This fix adds the overall total steps so that end user could follow
the progress of the docker build.

An additonal test has been added to cover the changes.

This fix fixes 24912.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-07-24 08:13:58 -07:00
Vincent Demeester
3742557ed4 Merge pull request #24932 from thaJeztah/change-to-camelBack-for-consistency
Change "rotate_worker_token" to "rotateWorkerToken"
2016-07-24 10:05:07 +02:00
Madhu Venugopal
48d0b81181 Merge pull request #24954 from aboch/lnk
Fix regression on --link on bridge network
2016-07-23 04:47:57 -07:00
allencloud
4e959ef2f7 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-23 11:32:23 +08:00
Alessandro Boch
3a3f800ff4 Fix regression on --link on bridge network
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-22 18:52:46 -07:00
Sebastiaan van Stijn
bd81df1278
Change "rotate_worker_token" to "rotateWorkerToken"
This renames the `rotate_xxx` flags to camelBack, for
consistency with other API query-params, such as
`detachKeys`, `noOverwriteDirNonDir`, and `fromImage`.

Also makes this flag accept a wider range of boolean
values ("0", "1", "true", "false"), and throw an error
if an invalid value is passed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-23 01:04:12 +02:00
Anusha Ragunathan
4a44cf1d4c Handle plugin shutdown when liveRestore is set.
When daemon has liveRestore set, daemon shutdown should not shutdown
plugins. Fixes #24759

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-07-22 15:26:43 -07:00
John Howard
2dba96ca2a Windows: nanoserver tlist not tasklist
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-07-22 12:55:46 -07:00
John Howard
0d4b8cbdac Windows: TestRunCleanupCmdOnEntrypoint for nanoserver
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-07-22 09:05:38 -07:00
Sebastiaan van Stijn
796a19a785 Merge pull request #24918 from Microsoft/jjh/badtestcomment
Fix incorrect test comment
2016-07-22 14:30:18 +02:00
Sebastiaan van Stijn
ac63413a2c Merge pull request #24919 from Microsoft/jjh/TestRunLookupGoogleDNS
Windows: Fix TestRunLookupGoogleDNS for nanoserver
2016-07-22 11:21:28 +02:00
John Howard
80a63e8a21 Windows: Fix TestRunLookupGoogleDNS for nanoserver
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-07-21 19:46:17 -07:00
John Howard
b02107db8b Fix bad test comment
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-07-21 19:39:35 -07:00
Dong Chen
1b1a7f29e5 Add integration test for constraints.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2016-07-21 18:08:49 -07:00
Aaron Lehmann
2cc5bd33ee Replace secrets with join tokens
Implement the proposal from
https://github.com/docker/docker/issues/24430#issuecomment-233100121

Removes acceptance policy and secret in favor of an automatically
generated join token that combines the secret, CA hash, and
manager/worker role into a single opaque string.

Adds a docker swarm join-token subcommand to inspect and rotate the
tokens.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-21 15:23:03 -07:00
Sebastiaan van Stijn
bdf4d9c1cd Merge pull request #24884 from Microsoft/jjh/TestBuildWorkdirWindowsPath
Windows: TestBuildWorkdirWindowsPath hard code fix
2016-07-21 11:42:26 +02:00
John Howard
ceed93a874 Windows: TestBuildWorkdirWindowsPath hard code fix
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-07-20 21:23:38 -07:00
Tõnis Tiigi
ea59668046 Merge pull request #24563 from dperny/test-leader-election
Added leader election test
2016-07-20 16:02:09 -07:00
Sebastiaan van Stijn
4b7a83dbce Merge pull request #24853 from Microsoft/jjh/nanoserver
Windows: Allow nanoserver image for CLI
2016-07-20 22:50:08 +02:00
Sebastiaan van Stijn
7d84c71500 Merge pull request #24620 from yongtang/24270-service-list-filter
Allow partial name match for service ls --filter, node ls --filter, node tasks --filter
2016-07-20 21:25:06 +02:00
John Howard
624e6cdbf3 Windows: Allow nanoserver image for CLI
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-07-20 09:59:52 -07:00
Sebastiaan van Stijn
2a78789ad1 Merge pull request #24266 from allencloud/add_cmd_docker_stack_services_STACKNAME
add command `docker stack services STACKNAME`
2016-07-20 18:38:08 +02:00
Yong Tang
e734fa58ea Allow partial name match for node ls, and node tasks
This fix is an extension to last commit to expand the partial
filter to node and task searches.

Additional integration tests have been added to cover the changes.

This fix fixes 24270.
This fix fixes 24112.

Note: A separate pull request will be opened on swarmkit.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-07-20 08:16:10 -07:00
Brian Goff
a9b392014f Merge pull request #24653 from dongluochen/testrollingupdate
Add integration test for rolling update
2016-07-19 16:51:40 -04:00
Vincent Demeester
f2afd1a906 Merge pull request #24049 from tophj-ibm/remove-lingering-volume-from-tests
DockerExternalVolumeSuite: add daemon to test
2016-07-19 22:39:39 +02:00
Dong Chen
d327765a62 Test rolling update.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2016-07-19 12:09:30 -07:00
Drew Erny
3489e76513 Added leader election test
Signed-off-by: Drew Erny <drew.erny@docker.com>
2016-07-19 11:29:27 -07:00
Arnaud Porterie
ffba13f435 Merge pull request #24648 from mlaventure/fix-kill-test
Fix TestDaemonRestartWithKilledRunningContainer failures on RHEL systems
2016-07-19 18:24:34 +00:00
Kenfe-Mickael Laventure
64483c3bda Do not rely on "live" event anymore
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-19 08:24:39 -07:00
Doron Podoleanu
6bec735c91 Use const http status code instead of just numbers see #24783
Signed-off-by: Doron Podoleanu <doronp@il.ibm.com>
2016-07-19 10:40:20 +03:00
allencloud
4b21b411ec add command docker stack services STACKNAME
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-19 14:21:58 +08:00
Brian Goff
f49fdb9d0b Merge pull request #24755 from thaJeztah/fix-error-message
update "image delete" error to match actual behavior
2016-07-18 22:47:55 -04:00
Yong Tang
1d600ebcb5 Allow partial name match for service ls --filter
This fix tries to address the issue raised in 24270 where it was
not possible to have a partial name match when list services
with name filter.

This fix updates swarmkit and allows prefix search when name is
provided as the filter for listing services.

An additional integration test is added to cover the changes.

This fix fixes 24270.

Note: A separate pull request will be opened on swarmkit.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-07-18 17:53:08 -07:00
Sebastiaan van Stijn
340964db1c Merge pull request #24692 from anusha-ragunathan/plugins-ux
Print plugin name on successful install, enable and disable.
2016-07-19 01:09:35 +02:00
Arnaud Porterie
6fc46474fb Merge pull request #24701 from dperny/test-leader-proxy
Added test for leader proxying
2016-07-18 22:15:16 +00:00
Sebastiaan van Stijn
f0988dd395
update "image delete" error to match actual behavior
The error message;

    unable to delete .... (must be forced) - image is referenced in one or more repositories

Looks to be incorrect

Given the following images:

    docker images | grep 2d36b1c0ea40
    registry                           2                                     2d36b1c0ea40        7 weeks ago         171.2 MB
    registry                           2.4.1                                 2d36b1c0ea40        7 weeks ago         171.2 MB

Removing the image by *id* fails:

    docker rmi 2d36b1c0ea40
    Error response from daemon: conflict: unable to delete 2d36b1c0ea40 (must be forced) - image is referenced in one or more repositories

However, after untagging one image:

    docker rmi registry:2
    Untagged: registry:2

Removing the image works:

    docker rmi 2d36b1c0ea40
    Untagged: registry:2.4.1
    Deleted: sha256:2d36b1c0ea40159adc8b36f7563f1d7a6d443384fe2611e8b393c1cb3ae2e6ad
    Deleted: sha256:7abfddbf4e61927307b6646010845eeb7513ecc6541f33ea6103b2493e36aa4e
    Deleted: sha256:f512d7699dbb2994fe15d30ee1d404e57b58c3c310617b4471db649680b4cfa0
    Deleted: sha256:7291e34714908270aeda93f1dc681485f9734d41314e2fdc6c11f32ffa782a21
    Deleted: sha256:548f6562929484f3d78267e4b1e31dcfeb9f303059668888b4423ce5501c7fbc
    Deleted: sha256:afe56b46629e6d8e0bfc36fed13395a7cfa2bd83b58bb489976ef13553eff20b
    Deleted: sha256:cf0c3bd5d6a0a14ebf96cc7d3df79a37774a70f3086273e09da71a86fe74fec2
    Deleted: sha256:c5fdaf8b055f544d0211043e687905315c3a0b71c1c08df07e473dd0a30e43c8

    docker images | grep 2d36b1c0ea40
    <empty>

This changes the error message to reflect that behavior

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-18 23:17:55 +02:00
Drew Erny
d305aa48dd Added test for leader proxying
Signed-off-by: Drew Erny <drew.erny@docker.com>
2016-07-18 13:18:02 -07:00
Anusha Ragunathan
6dca1e6d3f Print plugin name on successful install, enable and disable.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-07-18 09:47:12 -07:00
Arnaud Porterie
ba6adc5f46 Merge pull request #24646 from anusha-ragunathan/use-volume-plugins
Remove use of exec-root in plugins due to socket pathname limits.
2016-07-18 16:28:22 +00:00
allencloud
e5bed17574 update comparison log in container config
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-16 11:26:19 +08:00
Anusha Ragunathan
21ecd5a93d Remove use of exec-root in plugins due to socket pathname limits.
Unix sockets are limited to 108 bytes. As a result, we need to be
careful in not using exec-root as the parent directory for pluginID
(which is already 64 bytes), since it can result in socket path names
longer than 108 bytes. Use /tmp instead. Before this change, setting:
- dockerd --exec-root=/go/src/github.com/do passes
- dockerd --exec-root=/go/src/github.com/doc fails
After this change, there's no failure.

Also, write a volume plugins test to verify that the plugins socket
responds.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-07-15 09:17:29 -07:00
Tonis Tiigi
f5fb3c69fd Fix panic in stats test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-07-14 17:30:57 -07:00
Daniel Nephin
4c6faa4340 Change the add/update flags to include 'add'
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-13 16:06:25 -04:00
Daniel Nephin
dc33fc1ff4 Add remove flags for service update
with unit tests

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-13 16:06:25 -04:00
Tibor Vass
778b38cbf1 Merge pull request #23324 from icecrime/add_run_network
Add run network
2016-07-12 14:59:48 -07:00
Tõnis Tiigi
08a2fd7e2e Merge pull request #24465 from LK4D4/restart_cluster_test
integration-cli: add test for restarting entire swarm cluster
2016-07-12 13:12:33 -07:00
Arnaud Porterie (icecrime)
c0c7d5e715
Rename --net to --network
Add a `--network` flag which replaces `--net` without deprecating it
yet. The `--net` flag remains hidden and supported.

Add a `--network-alias` flag which replaces `--net-alias` without deprecating
it yet. The `--net-alias` flag remains hidden and supported.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
2016-07-12 13:01:35 -07:00
Arnaud Porterie
79432b4367 Merge pull request #24528 from rsippl/24526-empty-services-list
Return an empty services list if no services are running
2016-07-12 18:31:28 +00:00
Ralf Sippl
65e72133a1 Add API test for empty services list
Signed-off-by: Ralf Sippl <ralf.sippl@gmail.com>
2016-07-12 17:31:44 +02:00
Sebastiaan van Stijn
110b2aecda Merge pull request #24504 from hqhq/soften_update_kmem
Soften limitation of update kernel memory
2016-07-12 13:58:17 +02:00
Vincent Demeester
1685b605a8 Merge pull request #24464 from tonistiigi/waitandassert
Use waitAndAssert to test node state changes
2016-07-12 10:05:55 +02:00
Brian Goff
b91e2dd994 Merge pull request #24229 from anusha-ragunathan/shutdown-plugins
Shutdown plugins during daemon shutdown.
2016-07-11 22:14:50 -04:00
Qiang Huang
08c7075c40 Soften limitation of update kernel memory
Kernel memory is not allowed to be updated if container is
running, it's not actually a precise kernel limitation.

Before kernel version 4.6, kernel memory will not be accounted
until kernel memory limit is set, if a container created with
kernel memory initialized, kernel memory is accounted as soon
as process created in container, so kernel memory limit update
is allowed afterward. If kernel memory is not initialized,
kernel memory consumed by processes in container will not be
accounted, so we can't update the limit because the account
will be wrong.

So update kernel memory of a running container with kernel memory
initialized is allowed, we should soften the limitation by docker.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-07-12 08:07:24 +08:00
Tibor Vass
880484992c Merge pull request #24501 from hqhq/remove_exec_driver
Remove execution driver
2016-07-11 16:54:36 -07:00
Alexander Morozov
ae4137ae3c integration-cli: add test for restarting entire swarm cluster
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-07-11 14:48:57 -07:00
Anusha Ragunathan
863ab9ab13 Shutdown plugins during daemon shutdown.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-07-11 14:21:27 -07:00
Vincent Demeester
46649755f8 Merge pull request #24051 from allencloud/return-err-when-stack-name-nonexist
output some details when stack name does not exist
2016-07-11 20:43:09 +02:00
Tonis Tiigi
f02ec39e99 Use waitAndAssert to test node state changes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-07-11 10:01:14 -07:00
allencloud
416613f2e5 return err when stack name does not exist
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-12 00:59:30 +08:00
Qiang Huang
1fb1136fec Remove execution driver
We use containerd and there is no execution driver anymore.

Addresses: https://github.com/docker/docker/issues/24461

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-07-11 14:52:27 +08:00
Antonio Murdaca
9fadb8fd6a integration-cli: fix --net=none tests
Example:

21:28:01 [d68573521] waiting for daemon to start
21:28:01 [d68573521] daemon started
21:28:01 docker_api_swarm_test.go:163:
21:28:01     c.Assert(d1.Init(map[string]bool{"worker": true}, ""),
checker.IsNil)
21:28:01 ... value *errors.errorString =
&errors.errorString{s:"initializing swarm: invalid statuscode 500,
\"{\\\"message\\\":\\\"could not determine local IP address: dial udp
8.8.8.8:53: connect: network is unreachable\\\"}\\n\"} ("initializing
swarm: invalid statuscode 500, \"{\\\"message\\\":\\\"could not
determine local IP address: dial udp 8.8.8.8:53: connect: network is
unreachable\\\"}\\n\"")
21:28:01
21:28:01 [d68573521] exiting daemon"}

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-07-10 15:56:02 +02:00
Tonis Tiigi
a3f1577365 Add more complicated demotion testcases
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-07-08 13:33:40 -07:00
Sebastiaan van Stijn
db435560b3 Merge pull request #24389 from Microsoft/jjh/silentsecurity
Windows: No security warning on quiet
2016-07-08 11:06:33 -07:00
Tibor Vass
07dd69df8d Merge pull request #23312 from justincormack/proxy
Make the docker proxy a standalone binary not a re-exec
2016-07-07 17:14:40 -07:00
John Howard
a9b3c1d720 Windows: No security warning on quiet
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-07-07 16:00:08 -07:00
Justin Cormack
6dfba780cc Fix test case for docker_api_swarm_test.go
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-07-07 21:01:55 +01:00
Tõnis Tiigi
db67db98d8 Merge pull request #24349 from aaronlehmann/swarm-secrets-by-default
Generate a swarm joining secret if none is specified
2016-07-07 11:43:08 -07:00
Sebastiaan van Stijn
6167a9ab16 Merge pull request #22868 from Microsoft/jjh/dockerfilecmd
Windows: CMD not honouring arg escaping
2016-07-07 09:21:26 -07:00
Vincent Demeester
656c66dd50 Merge pull request #24383 from anusha-ragunathan/not-plugin
Detect non-plugin content during install and error out.
2016-07-07 11:18:27 +02:00
Brian Goff
56f3422468 Use newer default values for mounts CLI
In the API:
`Writable` changed to `ReadOnly`
`Populate` changed to `NoCopy`

Corresponding CLI options updated to:
`volume-writable` changed to `volume-readonly`
`volume-populate` changed to `volume-nocopy`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-06 22:34:39 -04:00
Anusha Ragunathan
d32df6d934 Detect non-plugin content during install and error out.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-07-06 18:49:39 -07:00
Aaron Lehmann
7342e42fce Generate a swarm joining secret if none is specified
The current behavior of `docker swarm init` is to set up a swarm that
has no secret for joining, and does not require manual acceptance for
workers. Since workers may sometimes receive sensitive data such as pull
credentials, it makes sense to harden the defaults.

This change makes `docker swarm init` generate a random secret if none
is provided, and print it to the terminal. This secret will be needed to
join workers or managers to the swarm. In addition to improving access
control to the cluster, this setup removes an avenue for
denial-of-service attacks, since the secret is necessary to even create
an entry in the node list.

`docker swarm init --secret ""` will set up a swarm without a secret,
matching the old behavior. `docker swarm update --secret ""` removes the
automatically generated secret after `docker swarm init`.

Closes #23785

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-06 13:04:50 -07:00
Alexander Morozov
6f052edcc0 Merge pull request #24133 from cpuguy83/hacky_swarm_integration_tests
Implement service integration tests
2016-07-06 11:49:27 -07:00
Antonio Murdaca
a0c8970df1 integration-cli: ensure digest is the same after cross-repo push
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-07-06 13:12:42 +02:00
Brian Goff
e5ec575b32 Implement service integration tests
This is done in a hacky way as currently there is no better way.
Uses known implementation details about how tasks are scheduled to be
able to operate on the underlying container.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-05 21:39:42 -04:00
Arnaud Porterie
ee0283c97a Merge pull request #23996 from dmcgowan/always-store-image-digest-update
[carry 23503]  Always store the image digest when pulling and pushing an image.
2016-07-05 16:18:20 +00:00
Antonio Murdaca
98fa9ef7d3 Merge pull request #24300 from coolljt0725/arm64_test
Add NoArm64 testRequires and skip Schema1RegistrySuite on arm64
2016-07-05 12:13:30 +02:00
Lei Jitang
8c179348c3 Add fchmod and fchmodat to TestRunSeccompProfileDenyChmod
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-07-04 11:06:48 +00:00
Lei Jitang
9c1566a1df Add NoArm64 testRequires and skip Schema1RegistrySuite on arm64
schema1 manifests is not working on ARM64, we should skip integration-cli
tests for schema1 manifests on ARM64.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-07-04 10:09:46 +00:00
Otto Kekäläinen
644a7426cc Fix spelling in comments, strings and documentation
Signed-off-by: Otto Kekäläinen <otto@seravo.fi>
2016-07-03 20:58:11 +03:00
Tõnis Tiigi
a0d068e7c6 Merge pull request #24060 from Microsoft/jjh/skipruncidfilecleanupifemptyrs1
Windows: Skip RunCidFileCleanupIfEmpty on RS1
2016-06-30 16:36:41 -07:00
Tõnis Tiigi
9828960ade Merge pull request #24056 from Microsoft/jjh/skiptestbuildemptycmdrs1
Windows: Skip TestBuildEmptyCmd on RS1
2016-06-30 16:34:55 -07:00
Derek McGowan
8906f8307c Treat digest only images as dangling
Add test for dangling digest images

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-06-30 11:32:49 -07:00
Yong Tang
4bc91ceeb7 Use HOSTNAME in the output of docker node ls
This fix tries to address an issue raised in #24090 where
the title field of `docker node ls` use NAME instead of
HOSTNAME. Yet the content of this field is actually
hostname.

The fix makes needed changes for the output of
`docker node ls`.

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

This fix fixes #24090.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-29 19:54:16 -07:00
Alexander Morozov
9162011680 Merge pull request #23789 from tonistiigi/swarm-integration-tests
Update swarm integration tests and shutdown synchronization
2016-06-29 14:09:57 -07:00
Vincent Demeester
2f9d20288c Merge pull request #24050 from ncoolz/issue-cluster-store-config
Fix check code for --cluster-store and --cluster-advertise in config_…
2016-06-29 19:15:23 +02:00
Anusha Ragunathan
6d36431e23 Fix daemon tests.
Fix two test issues:
- pidof is not available in PATH on some Jenkins systems (rhel, centos)
  Use kill -0 instead.
- Cleanup after plugin test. This is a stop gap fix. The right way to
  fix this, is to shutdown the plugin on daemon shutdown path (except
  for the live-restore case). This will be done in a follow up PR.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-06-28 15:29:49 -07:00
Wonjun Kim
d71789828f Add integration tests for swarm incompatible
Signed-off-by: Wonjun Kim <wonjun.kim@navercorp.com>
2016-06-29 06:21:02 +09:00
John Howard
20424fccdd Windows: Skip RunCidFileCleanupIfEmpty on RS1
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-28 13:04:42 -07:00
John Howard
45da127442 Windows: Skip TestBuildEmptyCmd on RS1
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-28 12:22:16 -07:00
Christopher Jones
88ea43d2aa
DockerExternalVolumeSuite: add daemon to test
Part of #23998. Adds a daemon to this test, so that the
volume that's created is added to this test daemon's vol store
instead of the main test daemons.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-06-28 13:52:48 -04:00
Yong Tang
3f6e3a0885 Fix docker rename with linked containers
This fix tries to address issue raised in #23973 where the
`docker rename` does not update namedIndex and linkIndex,
thus resulting in failures when the linked containers are
referenced later on.

This fix updates the namedIndex and linkIndex during the
`docker rename` and fixes the issue.

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

This fix fixes #23973.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-27 19:58:05 -07:00
Michael Crosby
48eba0bfe6 Merge pull request #23677 from anusha-ragunathan/mv_test_stable
Move daemon restart tests from experimental to stable.
2016-06-27 13:07:55 -07:00
Michael Crosby
91fa49071d Merge pull request #23775 from mlaventure/change-stock-runtime-alias
Use "runc" as alias for the default runtime
2016-06-27 11:55:46 -07:00
Derek McGowan
33984f256b Always store the image digest when pulling and pushing an image.
Always attempt to add digest even when tag already exists.
Ensure digest does not currently exist.
When image id is mismatched, output an error log.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-06-27 10:09:57 -07:00
Vincent Demeester
1cfd37f432 Merge pull request #23801 from inercia/fix_docker_cli_by_digest
Make sure some integration tests check for the right return code
2016-06-27 15:37:59 +02:00
Alvaro Saurin
b5f51e5281 Change the comments in TestPullFailsWithAlteredLayer and TestPullFailsWithAlteredLayer
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2016-06-27 11:06:32 +02:00
Tonis Tiigi
caaf92f7b4 Disable iptables in swarm test daemons
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-24 15:47:37 -07:00
Tonis Tiigi
1acb8ef825 Add test for force-new-cluster
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-24 13:57:11 -07:00
Tonis Tiigi
22b34d6449 Switch node management tests to api types
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-24 11:51:43 -07:00
Vincent Demeester
88d1ee6c11 Merge pull request #23360 from sainath14/rename_error
docker rename fix to address the issue of renaming with the same name
2016-06-24 19:54:09 +02:00
Vincent Demeester
23696e8265 Merge pull request #23921 from tonistiigi/test-timeouts
Increase test timeouts for node state changes
2016-06-24 19:21:56 +02:00
Brian Goff
f6326d3076 Merge pull request #23802 from inercia/fix_docker_cli_run_test
Make sure we compare string with the same capitalization
2016-06-24 10:27:29 -04:00
Tonis Tiigi
2e5da44341 Increase test timeouts for node state changes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-23 17:30:42 -07:00
Tõnis Tiigi
487931902c Merge pull request #23790 from tonistiigi/skip-pull
Skip always pulling images on integration tests
2016-06-23 11:47:33 -07:00
Anusha Ragunathan
006d58d7e6 Add plugin restore tests.
Also live restore is stable now. So move experimental tests out to stable.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-06-22 19:04:26 -07:00
Kenfe-Mickael Laventure
69af7d0d13 Use "docker-runc" as alias for the default runtime
This also moves the variable holding the default runtime name from the
engine-api repository into docker repository

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-22 11:59:26 -07:00
Alexander Morozov
df6630f6a3 Merge pull request #23832 from tonistiigi/unify-swarm-init-update
Unify swarm init and update options
2016-06-22 11:56:07 -07:00
Sven Dowideit
e76e52b38b Merge pull request #23738 from psiclops/typos
Fix misspell typos
2016-06-22 11:56:13 +10:00
Tonis Tiigi
fb3eb1c27e Unify swarm init and update options
Add api side validation and defaults for init and
join requests.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-21 16:34:32 -07:00
Alexander Morozov
7b2b4eb40c Merge pull request #23700 from Microsoft/jjh/fixrotestcases
Windows: Fix RO test cases
2016-06-21 09:01:43 -07:00
Alvaro Saurin
41cc7c4d9d Make sure we are trying to unmount a mounted /etc/resolv.conf
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2016-06-21 10:38:45 +02:00
Alvaro Saurin
ded347e744 Make sure we compare strings with the same capitalization
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2016-06-21 10:35:50 +02:00
Tonis Tiigi
e2226223e6 Skip always pulling images on integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-20 17:45:29 -07:00
John Howard
03816ad5b5 Windows: Fix RO test cases
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-20 10:15:20 -07:00
Alexander Morozov
7d7d8fa752 Merge pull request #23449 from HackToday/improveunit
Improve the TestEventsContainerWithMultiNetwork UT
2016-06-20 09:38:22 -07:00
Alexander Morozov
1475557341 Merge pull request #23649 from dmcgowan/image-delete-last-repo-ref
Update rmi logic for canonical references
2016-06-20 09:35:16 -07:00
Vincent Demeester
4cc70c921f Merge pull request #23723 from tonistiigi/incomplete-restore
Don’t try to restore swarm from incomplete state
2016-06-19 19:56:39 +02:00
nick
7135afa79b Fix misspell typos
Signed-off-by: nick <nicholasrusso@icloud.com>
2016-06-19 09:53:31 -07:00
Vincent Demeester
ce72bf8028 Merge pull request #23720 from yongtang/23716-renaming-started-container
Fix `docker start` error with renamed container
2016-06-19 13:56:13 +02:00
Tonis Tiigi
ded1d9af38 Don’t try to restore swarm from incomplete state
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-18 19:43:47 -07:00
Yong Tang
6e86733b47 Fix docker start error with renamed container
This fix tries to fix the issue raised in #23716 where `docker start`
causes an error of `No such container:` if the container has been
renamed before `docker start` returns.

The issue is that `docker start` use container name passed at the
beginning to check for exit code at the end of the `docker start`.

This fix addresses the issue by always use container's `ID` to get
the information during `docker start`.

Additional integration tests have been added to cover this fix.

This fix fixes #23716.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-18 16:43:30 -07:00
Dmitri Shuralyov
8cf4133f37 integration-cli: Change "Dns" to "DNS".
This fixes a minor lint/style issue, improves consistency.

According to Go style, which this project follows, acronyms should have
a consistent case. Source: https://github.com/golang/go/wiki/CodeReviewComments#initialisms

See https://github.com/docker/docker/pull/11310#discussion_r67394302.

Signed-off-by: Dmitri Shuralyov <shurcooL@gmail.com>
2016-06-18 16:32:27 -07:00
Arnaud Porterie (icecrime)
1f8ab93b44
Change docker service update semantics
Change `docker service update` to replace attributes of the target
service rather than augment them. One particular occurrence where the
previous behavior proved problematic is when trying to update a port
mapping: the merge semantics provided no way of removing published
ports, but strictly of adding more.

The utility merge* functions where renamed accordingly to update*.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
2016-06-17 17:09:40 -07:00
Derek McGowan
5cff374b14 Add tests for rmi
Add integration test for removing by image id with tag and digest reference to the same repository.
Add integration test to ensure only tag to other repository remains after deleting tag with accompanying digest reference.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-06-17 10:15:56 -07:00
Tibor Vass
4b70d4561e plugins: install should not automatically accept all permissions
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-06-17 10:03:30 -07:00
Anusha Ragunathan
22e781e8e3 Add disable flag for plugin Install.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-06-17 07:48:43 -07:00
Arnaud Porterie
f52c807650 Merge pull request #23651 from tonistiigi/cert-expiry
Add cert-expiry to swarm update
2016-06-17 02:50:58 +00:00
Tonis Tiigi
a933ac3c27 Add integration test for parsing swarm update options
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-16 19:50:01 -07:00
Arnaud Porterie
f4de3f314e Merge pull request #23644 from tonistiigi/fix-leave-delete
Fix removing containers on leaving from pending state
2016-06-17 01:40:45 +00:00
Arnaud Porterie
0ef720eded Merge pull request #23643 from tonistiigi/membership
Return membership status on join without timeout
2016-06-17 01:40:06 +00:00
Arnaud Porterie
16a6987a00 Merge pull request #23549 from dmcgowan/reference-ui-updates
Do not show empty tags for digest references in output
2016-06-17 00:47:49 +00:00
Tonis Tiigi
826f6f0703 Fix removing containers on leaving from pending state
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-16 16:08:15 -07:00
Tonis Tiigi
1973cee0cd Return membership status on join without timeout
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-16 15:27:08 -07:00
Tibor Vass
6b4e2ad90b Merge pull request #23520 from yongtang/23500-docker-info-security
Add security info to `docker info`
2016-06-16 15:15:33 -07:00
Tõnis Tiigi
6577031787 Merge pull request #23606 from vieux/fix_secrets
fix docker swarm init/update --secret
2016-06-16 14:24:35 -07:00
Tonis Tiigi
aed7667bee Add api tests for secret update
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-16 13:21:55 -07:00
Thomas Leonard
18a59bb869 Remove out-of-date health test
The test was waiting for the container to exit after failing its
healthcheck. However, we no longer automatically terminate containers,
so this waited instead for the container to time-out by itself.

Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
2016-06-16 13:09:57 +01:00
Vincent Demeester
6253c29494 Merge pull request #23583 from anusha-ragunathan/accept-perms
Add accept-permissions flag for install.
2016-06-16 12:44:37 +02:00
Arnaud Porterie
e3ad63f7e4 Merge pull request #23582 from tophj-ibm/fix-typo-in-daemon-test
Fix daemon test typo
2016-06-16 05:22:50 +00:00
Arnaud Porterie
17bf13b1b2 Merge pull request #23558 from mlaventure/fix-arm-test-for-multiple-runtimes
Fix TestRunWithRuntime* on arm
2016-06-16 04:09:15 +00:00
Victor Vieux
085895342c fix docker swarm init/update --secret
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-06-15 17:05:10 -07:00
John Howard
d05d0211bc Windows: CMD not honouring arg escaping
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-15 16:46:32 -07:00
Anusha Ragunathan
a2d48c9e4e Add basic integration tests for plugins.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-06-15 15:19:19 -07:00
Christopher Jones
51c0c6212d
Fix test typo
Changes daemn to daemon

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-06-15 13:45:25 -04:00
Tonis Tiigi
22f827abab Fix hanging integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-15 10:19:45 -07:00
Arnaud Porterie
480d7b310b Merge pull request #23301 from runcom/tmpfs-trump
daemon: allow tmpfs to trump over VOLUME(s)
2016-06-15 17:11:00 +00:00
Antonio Murdaca
756f6cef4a daemon: allow tmpfs to trump over VOLUME(s)
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-15 16:01:51 +02:00
Vincent Demeester
e08aed59df Merge pull request #23322 from tkopczynski/20784-builder-dockerfile-symlink
Reimplement integration test for symlink Dockerfile as a unit test
2016-06-15 10:52:49 +02:00
Derek McGowan
79eada3814 Do not show empty tags for digest references in output
When a repository has a tag and digests, show tag for each digest value.
Do not duplicate rows for the same image name with both tag and digest.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-06-14 22:44:49 -07:00
Arnaud Porterie
91197953d0 Merge pull request #23524 from aboch/restore
Daemon to support network restore
2016-06-15 02:33:16 +00:00
Arnaud Porterie
574f7d2149 Merge pull request #23551 from tonistiigi/update-swarmkit
Update swarmkit to 25572005f
2016-06-15 02:25:31 +00:00
Kenfe-Mickael Laventure
bd6317031b Fix TestRunWithRuntime* on arm
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-14 18:59:22 -07:00
Michael Crosby
cd03a68d31 Merge pull request #23530 from crosbymichael/exp-tests
Kill containers after restart tests
2016-06-14 17:43:52 -07:00
Brian Goff
6ed921dc38 Merge pull request #23446 from tiborvass/plugins-experimental
Plugins: experimental support for new plugin management
2016-06-14 20:32:14 -04:00
Tonis Tiigi
b38408fd02 Update drain test
With the rolling update there can be a possibility
that the container count matches the update has
completely finished yet.

The actual bug for the flakiness was fixed with the
swarmkit update.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-14 17:25:17 -07:00
Lei Jitang
7d0689a8d3 Add test case for network restore
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-06-14 16:45:30 -07:00
Michael Crosby
e07d78d247 Kill containers after restart tests
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-06-14 16:17:36 -07:00
Michael Crosby
c97fdbe3c5 Merge pull request #23415 from aboch/ll
Allow user to specify container's link-local addresses
2016-06-14 15:47:54 -07:00
Alessandro Boch
1c4efb6aa0 Allow user to specify container's link-local addresses
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-14 14:28:33 -07:00
Tibor Vass
f37117045c plugins: experimental support for new plugin management
This patch introduces a new experimental engine-level plugin management
with a new API and command line. Plugins can be distributed via a Docker
registry, and their lifecycle is managed by the engine.
This makes plugins a first-class construct.

For more background, have a look at issue #20363.

Documentation is in a separate commit. If you want to understand how the
new plugin system works, you can start by reading the documentation.

Note: backwards compatibility with existing plugins is maintained,
albeit they won't benefit from the advantages of the new system.

Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-06-14 14:20:27 -07:00
Brian Goff
9c52b11e2a TestCleanupMountsAfterGracefulShutdown wait for daemon exit
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-06-14 17:14:53 -04:00
Tomasz Kopczynski
830584b011 Reimplement integration test for symlink Dockerfile as a unit test
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
2016-06-14 23:07:19 +02:00
Yong Tang
eee20b564f Add security info to docker info
The security infomation has already been added to `GET /info` in #21172.
However, it is not part of the output of `docker info` yet.

This fix adds the security information to `docker info`.

Additional tests has been added to cover changes.

This fix fixes #23500. This fix is related to #20909, #21172.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-14 12:23:45 -07:00
Michael Crosby
6381ed14d1 Merge pull request #22983 from mlaventure/multiple-runtimes
Add support for multiple runtimes
2016-06-14 11:59:34 -07:00
Tonis Tiigi
32f18616c7 Temporarily skip flaky part of the drain test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-14 10:20:40 -07:00
Kenfe-Mickael Laventure
77efe6dffc Skip TestRunResolvconfUpdate as it is unstable
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-14 07:47:31 -07:00
Kenfe-Mickael Laventure
1f266d40f3 Fix race in DockerExternalGraphdriverSuite.TestExternalGraphDriver
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-14 07:47:31 -07:00
Kenfe-Mickael Laventure
7b2e5216b8 Add support for multiples runtimes
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-14 07:47:31 -07:00
Tibor Vass
a1e319e847 Merge pull request #23361 from docker/swarm
Add dependency to docker/swarmkit
2016-06-14 00:55:55 -07:00
Vincent Demeester
7d988a7aa6 Merge pull request #23093 from tkopczynski/20784-builder-dockerfile-outside-context
Builder integration tests for Dockerfile outside context as a unit test
2016-06-14 08:44:24 +02:00
Daniel Nephin
12a00e6017 Add Swarm management CLI commands
As described in our ROADMAP.md, introduce new Swarm management commands
to call to the corresponding API endpoints.

This PR is fully backward compatible (joining a Swarm is an optional
feature of the Engine, and existing commands are not impacted).

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-13 22:17:15 -07:00
Tonis Tiigi
0d88d5b64b Swarm integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-06-13 22:16:18 -07:00
Michael Crosby
3020081e94 Merge pull request #23213 from crosbymichael/restore-option
Add --live-restore flag
2016-06-13 20:57:19 -07:00
Michael Crosby
d705dab1b1 Add --live-restore flag
This flags enables full support of daemonless containers in docker.  It
ensures that docker does not stop containers on shutdown or restore and
properly reconnects to the container when restarted.

This is not the default because of backwards compat but should be the
desired outcome for people running containers in prod.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-06-13 19:16:26 -07:00
Vincent Demeester
5338ae7133 Merge pull request #23425 from runcom/authz-race
pkg: authorization: lock when lazy loading
2016-06-13 23:20:37 +02:00
Antonio Murdaca
d1b7e8373b authz: cleanups
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-12 17:23:19 +02:00
Vincent Demeester
4dafd107ad Merge pull request #22777 from WeiZhang555/wait-restarting
Bug fix: `docker run -i --restart always` hangs
2016-06-12 13:01:20 +02:00
Yong Tang
d917723331 Fix incorrect usage of logrus when formatting string is present
This fix tries to fix logrus formatting by adding `f` to the end of
`logrus.[Error|Warn|Debug|Fatal|Panic|Info](` when formatting string
is present but the function `logrus.[Error|Warn|Debug|Fatal|Panic|Info](`
is used (incorrectly).

This fix is related to #23459, and is a follow up of #23461.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-11 15:37:36 -07:00
Kai Qiang Wu(Kennan)
e0de1718ee Improve the UT
As the #23387 comment, the temp fix for UT need to be improved
to make it test the expected behavior. So let's add it.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-06-11 07:00:31 +00:00
Vincent Demeester
51f0def774 Merge pull request #23400 from runcom/fix-digest-test
integration-cli: use distribution/reference.DigestRegexp
2016-06-10 11:56:14 +02:00
Antonio Murdaca
0bc88d5b0a integration-cli: use distribution/reference.DigestRegexp
from a docker push output digest.DigestRegexp.FindString(output) does
not retrive the sha256: prefixed digest but just a string - in many
cases it's the registry host. The checks in the code are completely
wrong then. Fix this by using the DigestRegexp from the
distribution/reference package which correctly retrieves the digest
from the output.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-09 11:11:08 +02:00
Jess Frazelle
982c5f199f
fix default tmpfs size to prevent breakage
Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-06-09 00:58:06 -07:00
Sainath Grandhi
3e8c16ef6d docker rename fix to address the issue of renaming with the same name issue #23319
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2016-06-08 15:32:40 -07:00
Sebastiaan van Stijn
7d22eb072c
fix TestEventsContainerWithMultiNetwork
the order in which disconnect takes place is undetermined,
so don't check for the full name

this test was passing due to a previous bug, that
always returned the same network-name.

this bug was recently fixed in 148bcda329
(pull request 23375), exposing this test to be
flaky.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-06-08 23:09:20 +02:00
Alexander Morozov
3b08711bb7 Merge pull request #23343 from vdemeester/migrate-build-to-cobra
Use spf13/cobra for docker build
2016-06-08 11:59:48 -07:00
Michael Crosby
393e97e435 Merge pull request #23002 from Microsoft/jjh/readonly
Windows: Support RO volumes 14350+
2016-06-08 11:18:48 -07:00
Brian Goff
9db33b7646 Merge pull request #23377 from vdemeester/carry-pr-23007
Carry #23007 :  Say something useful during docker load
2016-06-08 13:42:22 -04:00
Vincent Demeester
148bcda329 Merge pull request #23375 from HackToday/fixnetworkmap
Fix wrong map usage
2016-06-08 18:19:08 +02:00
Doug Davis
6986a3220f Say something useful during docker load
During a `docker load` there are times when nothing is printed
to the screen, leaving the user with no idea whether something happened.
When something *is* printed, often its just something like:
```
1834950e52ce: Loading layer 1.311 MB/1.311 MB
5f70bf18a086: Loading layer 1.024 kB/1.024 kB
```
which isn't necessarily the same as the image IDs.

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

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

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

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

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

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

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-06-08 17:17:05 +02:00
Kai Qiang Wu(Kennan)
1cac7e6cbd Fix wrong map usage
As map reference, if all networks use same, it could cause strange
results.
Closes: #23304
Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-06-08 14:36:47 +00:00
Ben Firshman
322e2a7d05 Return remote API errors as JSON
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2016-06-07 18:45:27 -07:00
John Howard
8d174a43ba Windows: Support RO volumes 14350+
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-07 14:55:36 -07:00
Brian Goff
ce96ce9e05 Merge pull request #23311 from WeiZhang555/cobra-rm
Migrate rm command to cobra
2016-06-07 17:05:21 -04:00
Alexander Morozov
8cd6977f98 Merge pull request #23338 from vdemeester/23253-fix-create-run
Fix create command flags
2016-06-07 10:46:45 -07:00
Vincent Demeester
60f447b655
Migrate docker build to cobra
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-07 18:15:44 +02:00
Sebastiaan van Stijn
7c46ba02e6
add support for filtering by network ID
This adds support for filtering by network ID, to be
consistent with other filter options.

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-06-07 16:50:31 +02:00
Sainath Grandhi
912af1ae8f Adding network filter to docker ps command
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2016-06-07 16:43:11 +02:00
Zhang Wei
7702f39fe8 Migrate rm command to cobra
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-07 22:19:16 +08:00
Sebastiaan van Stijn
085f41b6a5
Fix TestRenameInvalidName
Change the test back to what it was before
e83dad090a

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

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

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-07 14:11:11 +02:00
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