Commit Graph

2100 Commits

Author SHA1 Message Date
5a458f78ee Move volume ref counting store to a package.
- Add unit tests to make sure the functionality is correct.
- Add FilterByDriver to allow filtering volumes by driver, for future
  `volume ls` filtering and whatnot.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 72bb56618b522fc3cece7cfd706c56296824673d
Component: engine
2015-09-21 12:46:49 -04:00
7f1e77e56a Cleanup: remove unnecessary return at the end of block in volumes.go
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 5746eb950130793a1833860b7bc03c2c8fa7b46f
Component: engine
2015-09-21 04:32:37 -04:00
64aea80dba Merge pull request #16349 from cpuguy83/16302_deprecate_autocreate_binds
deprecate bind path auto-create
Upstream-commit: e61abac5fa1c1ce2330e34c8eb51d9592dde2dd3
Component: engine
2015-09-18 12:53:06 -07:00
f1ab116cf0 Merge pull request #16403 from runcom/fix-containers-json-emtpy-response
Fix GET /containers/json emtpy response regression
Upstream-commit: 96f9efc0636be5d89fd242e7a5aa96485b80ad01
Component: engine
2015-09-18 11:47:42 -07:00
cdae9e4a30 events/jsonmessage: add and prefer TimeNano for events
This way provide both Time and TimeNano in the event. For the display of
the JSONMessage, use either, but prefer TimeNano Proving only TimeNano
would break Subscribers that are using the `Time` field, so both are set
for backwards compatibility.

The events logging uses nano formatting, but only provides a Unix()
time, therefor ordering may get lost in the output. Example:
```
2015-09-15T14:18:51.000000000-04:00 ee46febd64ac629f7de9cd8bf58582e6f263d97ff46896adc5b508db804682da: (from busybox) resize
2015-09-15T14:18:51.000000000-04:00 a78c9149b1c0474502a117efaa814541926c2ae6ec3c76607e1c931b84c3a44b: (from busybox) resize
```

By having a field just for Nano time, when set, the marshalling back to
`time.Unix(sec int64, nsec int64)` has zeros exactly where it needs to.
This does not break any existing use of jsonmessage.JSONMessage, but now
allows for use of `UnixNano()` and get event formatting that has
distinguishable order. Example:
```
2015-09-15T15:37:23.810295632-04:00 6adcf8ed9f5f5ec059a915466cd1cde86a18b4a085fc3af405e9cc9fecbbbbaf: (from busybox) resize
2015-09-15T15:37:23.810412202-04:00 6b7c5bfdc3f902096f5a91e628f21bd4b56e32590c5b4b97044aafc005ddcb0d: (from busybox) resize
```

Including tests for TimeNano and updated event API reference doc.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 4026512a2c535fe377a4cf834b7a78fccfd82dab
Component: engine
2015-09-18 13:15:26 -04:00
3afb789aff Fix GET /containers/json emtpy response regression
GET /containers/json route used to reply with and empty array `[]` when no
containers where available. Daemon containers list refactor introduced
this bug by declaring an empty slice istead of initializing it as well
and it was now replying with `null`.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 26bd5e3a2da3157f0bcb6654c30b6eccedf7f3f3
Component: engine
2015-09-18 18:44:46 +02:00
4e8ec3d151 deprecate bind path auto-create
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 249f45bcfe1adf4b3550306951f2768b17802217
Component: engine
2015-09-18 10:28:38 -04:00
3904dd3167 Move api/errors/ to errors/
Per @calavera's suggestion: https://github.com/docker/docker/pull/16355#issuecomment-141139220

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: a283a30fb026aad4434a9f2e34f7ce955d27a957
Component: engine
2015-09-17 11:54:14 -07:00
2d5e18cda2 Merge pull request #16355 from duglin/DaemonErrors
Convert some "daemon" static error strings to the new errocode package format
Upstream-commit: 828e4ac45a5b4954997949570b9b032c57137849
Component: engine
2015-09-17 11:48:37 -07:00
3d67e39b1a Merge pull request #16370 from mountkin/daemon-cleanup
remove the unused run() and output() functions in daemon/container.go
Upstream-commit: e33b8b11afd9d2b830ffed11f3c70e7448be1ff4
Component: engine
2015-09-17 17:33:55 +02:00
d13159ba93 Merge pull request #16361 from MHBauer/stats-refactor
refactor stats to not use internal data structures
Upstream-commit: cafee2eb4544442cd1307c1484235261b5b2752a
Component: engine
2015-09-17 08:28:07 -07:00
d6c0223ae2 remove the unused run() and output() functions in daemon/container.go
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: b79782e9516188e4c6e0d2e20d4a42d91f1c0c3c
Component: engine
2015-09-17 19:22:25 +08:00
c2bb8dcb02 Merge pull request #15384 from phil-monroe/15058-include-name-in-syslog-tag
log driver - Interpolate fields into log tag
Upstream-commit: 4dfa996cc246691de5e6f509939b96e8643ac228
Component: engine
2015-09-16 23:33:34 -04:00
b23ea59e6d refactor stats to not use internal data structures
- refactor to make it easier to split the api in the future
 - addition to check the existing test case and make sure it contains
   some expected output

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
Upstream-commit: 2d5d606fd368814ead4ff189eeae264f2af8691b
Component: engine
2015-09-16 17:28:52 -07:00
2f2b741d7b Merge pull request #16357 from Microsoft/10662-enabledockervolume
Windows: Enable docker volume
Upstream-commit: b0b3bc56d05ea1de7d5510dd00bb1cb63ac0b0c7
Component: engine
2015-09-16 16:42:50 -07:00
6295202aba Convert some "daemon" static error strings to the new errocode package format
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: f7d4b4fe2b130a522dee847a657218806180fa52
Component: engine
2015-09-16 16:16:42 -07:00
bd692d4b30 log driver - add ability to interpolate container context into the log tag field
Signed-off-by: Philip Monroe <phil@philmonroe.com>
Upstream-commit: 3be7146e14d1f5ced470c0c7e3066f091f468696
Component: engine
2015-09-16 15:19:28 -07:00
9f76426e0b Windows: Enabled docker volume
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 42a46ed1a4cd1a6116b3bc5018c29c80db93f928
Component: engine
2015-09-16 14:33:13 -07:00
655513db24 Add support for DNS options
Signed-off-by: Tim Hockin <thockin@google.com>
Upstream-commit: 3d4685e258a7729bd0f8cc411b5a73980a9faa20
Component: engine
2015-09-16 14:06:45 -07:00
9ef3eefa22 Merge pull request #16316 from vbatts/vbatts-events
daemon/events: let Log be [slightly] blocking
Upstream-commit: b9a3660d1e007a38585e0bb769169ea0911c0e18
Component: engine
2015-09-16 13:57:06 -07:00
a067d73ef6 Merge pull request #16305 from estesp/hooks-for-the-hooks-gods
Use libcontainer hook for network namespace info passing to libnetwork's sandbox
Upstream-commit: ac34ce0307aeeeba715e16d3cac8e5a7a07a6e1e
Component: engine
2015-09-16 13:55:16 -07:00
5e58ae50d3 Merge pull request #15786 from HuKeping/stats-network
Refactor the statistics of network in docker stats
Upstream-commit: 259a0fb16ceac921763172127183059dea7e3c46
Component: engine
2015-09-16 20:29:16 +02:00
fd675380c0 Revert "Make daemon to start with no userlandproxy by default"
This reverts commit bf2b8ec8165468d7454f6bd86f4a78e7e8b58d8e.

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 50d7fba7758e8890d49f492c284262ec9aa22190
Component: engine
2015-09-16 09:56:38 -07:00
e3b5e8b7ff Update native execdriver to exploit libcontainer hooks
Using @mavenugo's patch for enabling the libcontainer pre-start hook to
be used for network namespace initialization (correcting the conflict
with user namespaces); updated the boolean check to the more generic
SupportsHooks() name, and fixed the hook state function signature.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: e148e763b8e7879855022690fdea88a6bf869195
Component: engine
2015-09-16 12:51:14 -04:00
5aa203fb95 Revert "Make events test more deterministic in go1.5"
This reverts commit 386aefb9fcf65f1a5f68fd61e5108ea0858d2d3f.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: fc77ea787e33864284c14ca743bf3ebc0f50c249
Component: engine
2015-09-15 15:55:18 -04:00
6bc65656e8 daemon/events: let Log be [slightly] blocking
With go1.5's concurrency, the use of a goroutine in Log'ing events was
causing the resulting events to not be in order.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 09e7dd03f8740d7865ea91c56a231ce9ae9bec82
Component: engine
2015-09-15 14:28:22 -04:00
8dd1931b2b volumes: add synchronization to Count and List
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 2d21996eec8d3e6100f19fa0d0fa7adad25285ca
Component: engine
2015-09-15 10:38:53 -07:00
19987593e7 Merge pull request #16285 from calavera/cleanup_volumes_when_create_fails
Remove volume references when container creation fails.
Upstream-commit: 59311faaed4e3384fc8da738a57a25f17ae07e05
Component: engine
2015-09-15 10:55:51 -04:00
700bfcfe4a Merge pull request #15069 from duglin/UseErrorPackage
Use the new error package
Upstream-commit: e91f2c26ce38787e159162d2c4a43744396e3308
Component: engine
2015-09-15 09:28:53 -04:00
852d9066b4 Merge pull request #16275 from coolljt0725/fix_register_failed_and_start
Fix container register failed during daemon start and then start the container
Upstream-commit: db2ac8655d046b97b33636077faa420a700d8bfc
Component: engine
2015-09-15 11:46:03 +02:00
c71aa53e3d Refactor the statistics of network in docker stats
For now docker stats will sum the rxbytes, txbytes, etc. of all
the interfaces.

It is OK for the output of CLI `docker stats` but not good for
the API response, especially when the container is in sereval
subnets.

It's better to leave these origianl data to user.

Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: d3379946ec96fb6163cb8c4517d7d5a067045801
Component: engine
2015-09-15 15:40:34 +08:00
36a12430ca Merge pull request #16282 from mavenugo/ln_uns
Vendor-in libnetwork 2baa2ddc78b42f011f55633282ac63a72e1b09c1
Upstream-commit: 370ca6e401b251085a33f50e842f6567d2e9924e
Component: engine
2015-09-14 22:18:50 -04:00
bfef76b67b Remove volume references when container creation fails.
Volumes are accounted when a container is created.
If the creation fails we should remove the reference from the counter.
Do not log ErrVolumeInUse as an error, having other volume references is
not an error.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 2c6c07752c8d89fa72249c24285ede1b4e579b24
Component: engine
2015-09-14 16:16:46 -04:00
bb8ff26c08 Use the new error package
This is the first step in converting out static strings into well-defined
error types.  This shows just a few examples of it to get a feel for how things
will look. Once we agree on the basic outline we can then work on converting
the rest of the code over.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 628b9a41b09fde3ce1493f7d4f1495b9afaa506c
Component: engine
2015-09-14 13:11:01 -07:00
7d3bcc0ea2 Remove unnecessary check for nil CString
@noxiouz points out that we don't need to check for a nil result from
C.CString(), since an out-of-memory condition causes a runtime panic
instead.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com> (github: nalind)
Upstream-commit: 11fda783f85e1f6027c997c6b044c65288c89099
Component: engine
2015-09-14 14:16:48 -04:00
7c0ce8d93c Vendor-in 2baa2ddc78b42f011f55633282ac63a72e1b09c1 for userns support
Changes include :
* libnetwork support for userns
* driver api change to have 1 interface per endpoint

Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: d0e0c13b603efaff14c0269d19ac7e3710307fab
Component: engine
2015-09-14 11:04:12 -07:00
2cfd978e65 Fix container register failed during daemon start and try to start the container
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: b4841dd2371cdab8ef6e01d8304622fdb3578644
Component: engine
2015-09-13 22:52:56 -04:00
357f37d8f7 Merge pull request #16244 from calavera/libcontainer_0_0_4
Vendor libcontainer v0.0.4
Upstream-commit: dac92a8afbe0900641afa00e33e84e180d432239
Component: engine
2015-09-13 22:24:44 -04:00
862065b3b2 Add log reading to the journald log driver
If a logdriver doesn't register a callback function to validate log
options, it won't be usable.  Fix the journald driver by adding a dummy
validator.

Teach the client and the daemon's "logs" logic that the server can also
supply "logs" data via the "journald" driver.  Update documentation and
tests that depend on error messages.

Add support for reading log data from the systemd journal to the
journald log driver.  The internal logic uses a goroutine to scan the
journal for matching entries after any specified cutoff time, formats
the messages from those entries as JSONLog messages, and stuffs the
results down a pipe whose reading end we hand back to the caller.

If we are missing any of the 'linux', 'cgo', or 'journald' build tags,
however, we don't implement a reader, so the 'logs' endpoint will still
return an error.

Make the necessary changes to the build setup to ensure that support for
reading container logs from the systemd journal is built.

Rename the Jmap member of the journald logdriver's struct to "vars" to
make it non-public, and to make it easier to tell that it's just there
to hold additional variable values that we want journald to record along
with log data that we're sending to it.

In the client, don't assume that we know which logdrivers the server
implements, and remove the check that looks at the server.  It's
redundant because the server already knows, and the check also makes
using older clients with newer servers (which may have new logdrivers in
them) unnecessarily hard.

When we try to "logs" and have to report that the container's logdriver
doesn't support reading, send the error message through the
might-be-a-multiplexer so that clients which are expecting multiplexed
data will be able to properly display the error, instead of tripping
over the data and printing a less helpful "Unrecognized input header"
error.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com> (github: nalind)
Upstream-commit: e611a189cb3147cd79ccabfe8ba61ae3e3e28459
Component: engine
2015-09-11 16:50:03 -04:00
fdfd5340a4 Vendor libcontainer v0.0.4
Noteworthy changes:

- Add Prestart/Poststop hook support
- Fix bug finding cgroup mount directory
- Add OomScoreAdj as a container configuration option
- Ensure the cleanup jobs in the deferrer are executed on error
- Don't make modifications to /dev when it is bind mounted

Other changes in runc:

https://github.com/opencontainers/runc/compare/v0.0.3...v0.0.4

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 55a601e3f135b0a3915b7f245142ed4e90d81005
Component: engine
2015-09-11 16:17:59 -04:00
70714f6d99 Merge pull request #16243 from LK4D4/fix_import
awslogs: fix logrus import
Upstream-commit: 9fbef808c1f44560b24b7c9a7dc68f8e8ff480b9
Component: engine
2015-09-11 12:46:57 -07:00
68a732e052 Make daemon to start with no userlandproxy by default
This PR makes a user visible behavior change with userland
proxy disabled by default and rely on hairpin NAT to be enabled
by default. This may not work in older (unsupported) kernels
where the user will be forced to enable userlandproxy if needed.

      - Updated the Docs
      - Changed the integration-cli to start with userlandproxy
	desiabled by default.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Upstream-commit: bf2b8ec8165468d7454f6bd86f4a78e7e8b58d8e
Component: engine
2015-09-11 11:58:35 -07:00
726b8dc951 awslogs: fix logrus import
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 32964def832f76f29991100c76af09513de19693
Component: engine
2015-09-11 11:05:06 -07:00
1e38e54eff Add STOPSIGNAL instruction to dockerfiles.
This way, images creators can set the exit signal their programs use.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 3781cde61ff10b1d9114ae5b4c5c1d1b2c20a1ee
Component: engine
2015-09-10 19:56:05 -04:00
d563cc164c Signal to stop a container.
Allow to set the signal to stop a container in `docker run`:
- Use `--stop-signal` with docker-run to set the default signal the container will use to exit.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 0e50d946a25beb134bce2aaf4a209b5cfcbacf8f
Component: engine
2015-09-10 19:56:05 -04:00
f9ba04b455 Merge pull request #16191 from runcom/daemon-remove-unused-function-params
daemon: remove unused function params
Upstream-commit: 65e43593f58b2eb0666a0cc90609aa3f56c6af6a
Component: engine
2015-09-10 10:23:52 -07:00
e5d596c8b2 Minor typo
Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: 40d3ce1063a4dabfb1634a4f0739dea05b63a344
Component: engine
2015-09-10 14:13:15 +08:00
56082f8faa Add awslogs driver for Amazon CloudWatch Logs
Signed-off-by: Samuel Karp <skarp@amazon.com>
Upstream-commit: 3effe484e6f572298d0c3490517f57391617aa51
Component: engine
2015-09-09 13:52:40 -07:00
2ced70f4fb daemon: remove unused function params
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 587823af2723801ffdb6841b6e2c3d7d73ff10db
Component: engine
2015-09-09 22:37:46 +02:00
3e720579c6 Merge pull request #16162 from cpuguy83/16071_fix_lstat_errors
Ignore stat errors on volume rm.
Upstream-commit: d3338494598c6d25153cd3e97a0a783ccd4e06d5
Component: engine
2015-09-09 11:55:14 -07:00