Commit Graph

62 Commits

Author SHA1 Message Date
cf0e8d8d85 Merge pull request #24533 from yongtang/24392-docker-info-label-duplicate-keys
Remove duplicate keys in labels of `docker info`
Upstream-commit: 411e7b4416fbac0601db1fa28b5152c23fcaf7bb
Component: engine
2016-10-24 18:12:28 -07:00
9a299b360f Make experimental a runtime flag
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 7781a1bf0fef748877326632b88e92fbf3c90daa
Component: engine
2016-10-24 15:20:01 -07:00
b33468451a Merge pull request #27460 from Microsoft/jjh/dockerpid
Windows: Calculate PID file after root
Upstream-commit: ce6cfef36d6fa52df6ebdd3dd996d6bebe0f308d
Component: engine
2016-10-22 13:41:42 +02:00
b898bdd8c2 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>
Upstream-commit: e4c9079d091a2eeac8a74a0356e3f348db873b87
Component: engine
2016-10-18 07:45:27 -07:00
4a60903d29 Merge pull request #27463 from Microsoft/jjh/runservice
Windows: Mark run-service flag as hidden
Upstream-commit: 15ea28f6db7339f8a44078f3ef70484c96eebce7
Component: engine
2016-10-18 15:51:10 +02:00
15c4940651 Update docker stop and docker restart to allow not specifying timeout and use the one specified at container creation time.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: cc703784f39fb3f585ec685cf7aeda6410648446
Component: engine
2016-10-17 12:53:35 -07:00
d1476e7d2c Windows: Mark run-service flag as hidden
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 102a38ceb13478351e32c9c40e31e5b3f3298e76
Component: engine
2016-10-17 12:21:31 -07:00
874ddf88be Windows: Calculate PID file after root
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 7453d028daaba786b7eaa55ce739e24becd09a33
Component: engine
2016-10-17 11:48:51 -07:00
3f0929f048 Merge pull request #27276 from yuexiao-wang/func-name
Modify function name from SetDaemonLogLevel to SetLogLevel
Upstream-commit: 62503f245f808a6847fe98a84bacfe5ed3bf5c18
Component: engine
2016-10-13 12:10:59 -07:00
d71f1080b9 Make authorization plugins use pluginv2.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: c5393ee147e981ded8fdf12c8da790abd1130175
Component: engine
2016-10-11 13:09:28 -07:00
a44c26a0a1 Modify function name from SetDaemonLogLevel to SetLogLevel
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: fe3ff54c7a87d475d5b2a799c5c85e6300c371db
Component: engine
2016-10-11 19:35:12 +08:00
d99e04e924 Write fatal error to event log if running as service
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
Upstream-commit: 40868e263d7a239aa10acd922bd69ba5a943781e
Component: engine
2016-09-19 22:36:33 +02:00
293cb24e33 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>
Upstream-commit: c9fb551d60584ac4ad01561e2f56b7b7cc9483b9
Component: engine
2016-09-13 14:21:58 -07:00
982e83123e Fix the clashing route syntax for checkpoint/container delete.
Signed-off-by: boucher <rboucher@gmail.com>
Upstream-commit: 0dfbf960d72fc3f7deec02cc3f36385361216794
Component: engine
2016-09-08 21:31:56 -04:00
7bef93723c Initial implementation of containerd Checkpoint API.
Signed-off-by: boucher <rboucher@gmail.com>
Upstream-commit: d8fef66b03c1ea8715470690efbd950033f7f628
Component: engine
2016-09-08 21:31:52 -04:00
3528fc09b1 Fix readme doc for dockerd
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 00dcbd0693482a103b0de1ae2d1cd6e9d5c84339
Component: engine
2016-09-01 14:47:51 +08:00
6e19944380 Merge pull request #25890 from cpuguy83/fix_swarm_control_sock_path
Use daemon exec root for swarm control socket
Upstream-commit: edafc642b2b12d7428e72f922a2b44c3b62ffc31
Component: engine
2016-08-30 08:51:52 -04:00
8ad0a6fe8f 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>
Upstream-commit: 6e7405ebd4df360bc84f651c977ece31283eb3ee
Component: engine
2016-08-25 13:09:36 -04:00
e263ef28d9 Remove old cli framework.
Also consolidate the leftover packages under cli.
Remove pkg/mflag.
Make manpage generation work with new cobra layout.
Remove remaining mflag and fix tests after rebase with master.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 14712f9ff0d20a3b64a60103608b8cc998909242
Component: engine
2016-08-25 13:09:04 -04:00
9d7fdddb73 Update unit tests for new cobra root command.
Cleanup cobra integration
Update windows files for cobra and pflags
Cleanup SetupRootcmd, and remove unnecessary SetFlagErrorFunc.
Use cobra command traversal

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 31bf9ca0c8cf29c1ba6cdc044e81c574161a0392
Component: engine
2016-08-25 13:09:04 -04:00
894a7b4b95 Convert dockerd to use cobra and pflag
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: fb83394714a9797f8ca5a08023a89560ce6c4aa3
Component: engine
2016-08-25 13:09:03 -04:00
6a8e5f14f6 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>
Upstream-commit: 4d95ea319c4905827fb66fc8da09a6a8ac558004
Component: engine
2016-08-19 16:43:57 -04:00
3fbb0152cb Merge pull request #25406 from pwzgorilla/master
use `proto` and `addr` replace `protoAddrParts[0]` and `protoAddrPart…
Upstream-commit: 3b1f82b52d53814e5ab60928de052ae2dba63f28
Component: engine
2016-08-10 14:07:30 +02:00
6e6c038441 use proto and addr replace protoAddrParts[0] and protoAddrParts[1]
Signed-off-by: mgniu <mgniu@dataman-inc.com>
Upstream-commit: dc4dcf89d885bc9bbd936337318236768dea478b
Component: engine
2016-08-10 16:03:00 +08:00
565fab494f Enable to dynamically reload authorization plugins via daemon.config
Following #22729, enable to dynamically reload/remove the daemon
authorization plugins (via standard reloading mechanism).
https://docs.docker.com/engine/reference/commandline/daemon/#daemon-
configuration-file

Daemon must store a reference to the authorization middleware to refresh
the plugin on configuration changes.

Signed-off-by: Liron Levin <liron@twistlock.com>
Upstream-commit: 4192fe9c06d150fadfe18f228a6f9c3875227b8a
Component: engine
2016-07-30 14:59:07 +03:00
bac80b795e Merge pull request #24822 from swernli/skipV1push
Fixing v2 registry restriction for non-linux platforms.
Upstream-commit: 0eb1323fba5a46209e4aa99282129b0673c491e3
Component: engine
2016-07-29 14:18:47 -07:00
eec8319268 Rename config LiveRestore to LiveRestoreEnabled
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: b94542239313bbf960e6718c6b54bbbcbacdfffa
Component: engine
2016-07-28 17:10:40 -07:00
c6812e2679 Merge pull request #24663 from hopkings2008/repeated_api
remove the second repeated line cli.api = api since api is a pointer
Upstream-commit: d8a2568e6b3aeab8d7d11a05d3ec98cf0245211d
Component: engine
2016-07-28 16:45:30 -07:00
062b507351 Make daemon events listen for plugin lifecycle events.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 42abccb841b5bc0d420044e69165852b0054c38f
Component: engine
2016-07-26 10:51:47 -07:00
2150ea40b1 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>
Upstream-commit: a0ccd0d42fdb0dd2005f67604cb81a5a6b26787e
Component: engine
2016-07-24 09:23:07 -07:00
51a6c88912 Fixing v2 registry restriction for non-linux platforms.
This fixes the hard coded restriction for non-linux platforms to v2 registries.  Previously, the check was above the flag parsing, which would overwrite the hard coded value and prevent correct operation.  This change also removes the related daemon flag from Windows to avoid confusion, as it has no meaning when the value is going to always be hard coded to true.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: adee28458c23581ac9afb163b7cce8c6bb1d2dee
Component: engine
2016-07-20 16:14:40 -07:00
00a715516e Merge pull request #24646 from anusha-ragunathan/use-volume-plugins
Remove use of exec-root in plugins due to socket pathname limits.
Upstream-commit: ba6adc5f46ae1e979551998a02e16e3396a77402
Component: engine
2016-07-18 16:28:22 +00:00
c4e34ed5c5 Improve flag help consistency, and update docs
This adds the `--live-restore` option to the documentation.

Also synched usage description in the documentation
with the actual description, and re-phrased some
flag descriptions to be a bit more consistent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 64a8317a5a306dffd0ec080d9ec5b4ceb2479a01
Component: engine
2016-07-16 01:58:01 +02:00
0633dc391e 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>
Upstream-commit: 21ecd5a93db34288c0c579d5738030716d7bef2d
Component: engine
2016-07-15 09:17:29 -07:00
c47515a372 remove the second repeated line cli.api = api since api is a pointer
Signed-off-by: yuzou <zouyu7@huawei.com>
Upstream-commit: cb31d03b58e51a8ff56a04e8e0b5e17693b03f78
Component: engine
2016-07-15 11:45:30 +08:00
53c33cc1be Add --oom-score-adjust to daemon
This adds an `--oom-score-adjust` flag to the daemon so that the value
provided can be set for the docker daemon's process.  The default value
for the flag is -500.  This will allow the docker daemon to have a
less chance of being killed before containers do.  The default value for
processes is 0 with a min/max of -1000/1000.

-500 is a good middle ground because it is less than the default for
most processes and still not -1000 which basically means never kill this
process in an OOM condition on the host machine.  The only processes on
my machine that have a score less than -500 are dbus at -900 and sshd
and xfce( my window manager ) at -1000.  I don't think docker should be
set lower, by default, than dbus or sshd so that is why I chose -500.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: a894aec8d81de5484152a76d76b80809df9edd71
Component: engine
2016-07-12 15:53:15 -07:00
f06eb442e7 Implement plugin restore after daemon restart
This ensures that:

- The in-memory plugin store is populated with all the plugins
- Plugins which were active before daemon restart are active after.
  This utilizes the liverestore feature when available, otherwise it
  manually starts the plugin.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: dfd91873056c172ffc061d882da0cd18204b521a
Component: engine
2016-06-15 13:39:33 -04:00
848e510213 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>
Upstream-commit: f37117045c5398fd3dca8016ea8ca0cb47e7312b
Component: engine
2016-06-14 14:20:27 -07:00
811cef6ca3 Add support for multiples runtimes
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 7b2e5216b89b4c454d67473f1fa06c52a4624680
Component: engine
2016-06-14 07:47:31 -07:00
be63983b3a Add Swarm management backend
As described in our ROADMAP.md, introduce new Swarm management API
endpoints relying on swarmkit to deploy services. It currently vendors
docker/engine-api changes.

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: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: 534a90a99367af6f6bba1ddcc7eb07506e41f774
Component: engine
2016-06-13 22:16:18 -07:00
9ada0cfc5f Merge pull request #23213 from crosbymichael/restore-option
Add --live-restore flag
Upstream-commit: 3020081e94277410984c62d12f88de3d4f258681
Component: engine
2016-06-13 20:57:19 -07:00
7af900395b 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>
Upstream-commit: d705dab1b1bd0a946d647374325d61fac57736db
Component: engine
2016-06-13 19:16:26 -07:00
5751f65265 Merge pull request #23473 from coolljt0725/fix_stop_crash
Fix shutdown daemon during daemon staring casue crash
Upstream-commit: d169f057d9007580aa7ddb3ca7fca8de1e481081
Component: engine
2016-06-13 20:08:12 +02:00
5fe11026e0 Fix shutdown daemon during starting causes daemon crash
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 3c25656efa812a4c969c833623f3b96f86116e77
Component: engine
2016-06-13 02:10:37 -04:00
4484af9ebf Fix typo in error message
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 4ace1811b4a0c0a48f1aeeba996b8096a3a4bb2d
Component: engine
2016-06-12 23:22:26 +02:00
04ae4edf2f Fix logrus formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.

This fix fixes #23459.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a72b45dbec3caeb3237d1af5aedd04adeb083571
Component: engine
2016-06-11 13:16:55 -07:00
bd8dbcc1e8 Merge pull request #22460 from jwhonce/wip/sigpipe
Ignore SIGPIPE events
Upstream-commit: 171af5493121bada5c0e8167ade44da52648d0e2
Component: engine
2016-06-02 16:05:22 +02:00
5742c6afc6 Merge pull request #23046 from mountkin/fix-23045
fix flaky test TestImportFileWithMessage
Upstream-commit: 0b5e84cc8d190520e55a80530d29c455805974af
Component: engine
2016-05-31 09:39:38 -07:00
847b3a490c fix flaky test TestImportFileWithMessage
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: 9d6989bbb61cc009262ed6cf2ada92e7350a58af
Component: engine
2016-05-27 23:19:29 +08:00
9b06540d32 Merge pull request #22840 from runcom/go1.6
Upgrade to golang 1.6.2
Upstream-commit: 9b0d385975c80359b4cab2c75e4834fe803e12d5
Component: engine
2016-05-27 06:54:57 -07:00