Commit Graph

94 Commits

Author SHA1 Message Date
Madhu Venugopal 401632c756 fixing ungraceful daemon restart case where nw connect is not persisted
For graceful restart case it was done when the container was brought
down. But for ungraceful cases, the persistence is missing for nw
connect

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-30 16:24:02 -07:00
David Calavera 0c991f3d68 Merge pull request #16779 from Microsoft/10662-execdrivercommand
Windows: Refactor execdriver.Command
2015-10-30 14:59:59 -07:00
John Howard 9d14866d71 Windows: Refactor execdriver.Command
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-30 13:53:00 -07:00
Brian Goff 78bd17e805 Force IPC mount to unmount on daemon shutdown/init
Instead of using `MNT_DETACH` to unmount the container's mqueue/shm
mounts, force it... but only on daemon init and shutdown.

This makes sure that these IPC mounts are cleaned up even when the
daemon is killed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-10-30 15:41:48 -04:00
Brian Goff 17a8fbeaeb Merge pull request #17514 from mavenugo/ugr
Fixing a case of dangling endpoint during ungraceful daemon restart
2015-10-30 13:38:27 -04:00
Michael Crosby aadae4b503 Merge pull request #16412 from Microsoft/10662-hyper-v-containers
Windows [TP4]: Adds support for Hyper-V Containers
2015-10-30 09:34:16 -07:00
Vincent Demeester 81c5b1ce4a Merge pull request #17492 from aidanhs/aphs-remove-dead-code
Remove dead code
2015-10-30 08:50:54 +01:00
Madhu Venugopal 0c07096b7d Fixes a case of dangling endpoint during ungraceful daemon restart
When a container restarts after a ungraceful daemon restart, first
cleanup any unclean sandbox before trying to allocate network resources.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-29 18:56:56 -07:00
John Howard 15e35c4470 Windows: Adds support for Hyper-V Containers
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-29 16:18:52 -07:00
Alessandro Boch e03daebb48 Execute buildPortMapInfo after Endpoint.Join()
- As the retrieved info may not be available at
  Endpoint creation time for certain network drivers
- Also retrieve the MAC address from Endpoint.Info().Iface()

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-29 11:47:30 -07:00
Aidan Hobson Sayers 164d0bca63 Remove dead code
Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
2015-10-29 16:56:29 +00:00
Lei Jitang 7fa601adc7 Fix docker inspect display odd gateway value for none network mode
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-10-27 21:47:12 -04:00
David Calavera 25682577c9 Extract network settings types for inspect.
Keeping backwards compatibility.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-10-27 19:16:21 -04:00
Lei Jitang 1b9a08e719 Fix docker inspect container only reports last assigned information
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-10-27 16:26:06 -04:00
Alessandro Boch 4f6f00e191 Do not update etc/hosts for every container
- Only user named containers will be published into
  other containers' etc/hosts file.
- Also block linking to containers which are not
  connected to the default network

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-26 20:08:57 -07:00
John Howard b1220a763c Windows: Refactor resources structure
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-26 13:48:16 -07:00
Alessandro Boch be1c77595e Disable built-in SD on docker0 network
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-23 19:46:28 -07:00
Tibor Vass e74cf8acad Merge pull request #16433 from Microsoft/10662-volumes5
Windows: [TP4] Add volume support
2015-10-23 18:43:07 -04:00
David Calavera 2afdc6582b Merge pull request #17274 from aboch/ai
Turn off discovery when icc == false
2015-10-22 13:08:31 -07:00
Alessandro Boch 20faaaa872 Turn off service discovery when icc==false
- Turn off built-in service discovery on docker0 bridge
  when icc is false

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-22 12:02:02 -07:00
John Howard a7e686a779 Windows: Add volume support
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-22 10:42:53 -07:00
David Calavera 678acbcb3f Merge pull request #16992 from burke/fix-mqueue
Fix --ipc=host dependency on /dev/mqueue existing
2015-10-21 11:25:37 -07:00
Tibor Vass 566964bf73 Merge pull request #17191 from mrjana/restart
Fix docker startup failure due to dangling endpoints
2015-10-20 10:32:33 -04:00
Jana Radhakrishnan 8adfc7e2d2 Fix docker startup failure due to dangling endpoints
Fixes docker startup failure due to dangling endpoints
which makes docker to not come up.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-19 21:29:35 -07:00
Madhu Venugopal 8755920d0d Fail the container start if the network has been removed
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-19 15:00:07 -07:00
Burke Libbey fd955ce6ca
Better error when --host=ipc but no /dev/mqueue
Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
2015-10-14 10:52:16 -04:00
Burke Libbey ab7923558d
Revert "Fix --ipc=host dependency on /dev/mqueue existing"
This reverts commit f624d6187a.

Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
2015-10-14 10:52:04 -04:00
Burke Libbey f624d6187a
Fix --ipc=host dependency on /dev/mqueue existing
Since #15862, containers fail to start when started with --ipc=host if
/dev/mqueue is not present. This change causes docker to create
container-local mounts for --ipc=host containers as well as in the
default case.

Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
2015-10-13 17:46:55 -04:00
Alexandre Beslic 4ea3ff7061 Merge pull request #16910 from mavenugo/ipam
Vendoring libnetwork for the pluggable IPAM driver support
2015-10-13 14:41:19 -07:00
Madhu Venugopal 0f351ce364 Docker side changes for the newly introduced IPAM driver
* Made use of IPAM driver primitives for legacy IP configurations
* Replaced custom Generics with backend labels

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-13 10:52:59 -07:00
Phil Estes ed68486f68 Make sure network files exist before adding them to mounts
It is possible that network files do not exist, especially in the case
of `--net=host` where a host OS (like CoreOS) does not use certain
standard network files.  This patch verifies that the source file of a
network mount point exists before adding it to the list of mount points
for bind mounting from the container's metadata directory.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-10-12 17:18:34 -04:00
Phil Estes 442b45628e Add user namespace (mapping) support to the Docker engine
Adds support for the daemon to handle user namespace maps as a
per-daemon setting.

Support for handling uid/gid mapping is added to the builder,
archive/unarchive packages and functions, all graphdrivers (except
Windows), and the test suite is updated to handle user namespace daemon
rootgraph changes.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-10-09 17:47:37 -04:00
Madhu Venugopal 2ab94e11a2 Network remote APIs using new router, --net=<user-defined-network> changes
* Moving Network Remote APIs out of experimental
* --net can now accept user created networks using network drivers/plugins
* Removed the experimental services concept and --default-network option
* Neccessary backend changes to accomodate multiple networks per container
* Integration Tests

Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-07 03:54:19 -07:00
Jessica Frazelle b8605a1107
do not mount /dev/shm or /dev/mqueue if we are mounting from the host
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-10-02 11:14:04 -07:00
Tibor Vass b08f071e18 Revert "Merge pull request #16228 from duglin/ContextualizeEvents"
Although having a request ID available throughout the codebase is very
valuable, the impact of requiring a Context as an argument to every
function in the codepath of an API request, is too significant and was
not properly understood at the time of the review.

Furthermore, mixing API-layer code with non-API-layer code makes the
latter usable only by API-layer code (one that has a notion of Context).

This reverts commit de41640435, reversing
changes made to 7daeecd42d.

Signed-off-by: Tibor Vass <tibor@docker.com>

Conflicts:
	api/server/container.go
	builder/internals.go
	daemon/container_unix.go
	daemon/create.go
2015-09-29 14:26:51 -04:00
Madhu Venugopal 6db1592066 Docker daemon changes to use default gateway service
* Thanks to the Default gateway service in libnetwork, we dont have to add
containers explicitly to secondary public network. This is handled
automatically regardless of the primary network driver.

* Fixed the URL convention for kv-store to be aligned with the upcoming
changes to discovery URL

* Also, in order to bring consistency between external and internal network
drivers, we moved the driver configs via controller Init.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-25 11:00:42 -07:00
David Calavera de41640435 Merge pull request #16228 from duglin/ContextualizeEvents
Add context.RequestID to event stream
2015-09-24 14:16:22 -07:00
Jess Frazelle 84b53c8d87 Merge pull request #14579 from hqhq/hq_add_softlimit
Add support for memory reservation
2015-09-24 12:11:36 -07:00
Doug Davis 26b1064967 Add context.RequestID to event stream
This PR adds a "request ID" to each event generated, the 'docker events'
stream now looks like this:

```
2015-09-10T15:02:50.000000000-07:00 [reqid: c01e3534ddca] de7c5d4ca927253cf4e978ee9c4545161e406e9b5a14617efb52c658b249174a: (from ubuntu) create
```
Note the `[reqID: c01e3534ddca]` part, that's new.

Each HTTP request will generate its own unique ID. So, if you do a
`docker build` you'll see a series of events all with the same reqID.
This allow for log processing tools to determine which events are all related
to the same http request.

I didn't propigate the context to all possible funcs in the daemon,
I decided to just do the ones that needed it in order to get the reqID
into the events. I'd like to have people review this direction first, and
if we're ok with it then I'll make sure we're consistent about when
we pass around the context - IOW, make sure that all funcs at the same level
have a context passed in even if they don't call the log funcs - this will
ensure we're consistent w/o passing it around for all calls unnecessarily.

ping @icecrime @calavera @crosbymichael

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-09-24 11:56:37 -07:00
Jess Frazelle 23750fb802 Merge pull request #15862 from calavera/share_shm_and_mqueue
Share shm and mqueue between containers.
2015-09-24 11:23:59 -07:00
Doug Davis 0a734182eb Move more 'daemon' errors to the new error package
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-09-23 09:51:45 -07:00
David Calavera b1d2f52bb2 Improvements to the original sharing implementation.
- Print the mount table as in /proc/self/mountinfo
- Do not exit prematurely when one of the ipc mounts doesn't exist.
- Do not exit prematurely when one of the ipc mounts cannot be unmounted.
- Add a unit test to see if the cleanup really works.
- Use syscall.MNT_DETACH to cleanup mounts after a crash.
- Unmount IPC mounts when the daemon unregisters an old running container.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-23 12:07:24 -04:00
qhuang aa1780997f Add support for memory reservation
Signed-off-by: qhuang <qhuang@10.0.2.15>
2015-09-23 14:02:45 +08:00
David Calavera 72bb56618b 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>
2015-09-21 12:46:49 -04:00
Doug Davis a283a30fb0 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>
2015-09-17 11:54:14 -07:00
Jess Frazelle 828e4ac45a Merge pull request #16355 from duglin/DaemonErrors
Convert some "daemon" static error strings to the new errocode package format
2015-09-17 11:48:37 -07:00
Doug Davis f7d4b4fe2b Convert some "daemon" static error strings to the new errocode package format
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-09-16 16:16:42 -07:00
Tim Hockin 3d4685e258 Add support for DNS options
Signed-off-by: Tim Hockin <thockin@google.com>
2015-09-16 14:06:45 -07:00
Jess Frazelle ac34ce0307 Merge pull request #16305 from estesp/hooks-for-the-hooks-gods
Use libcontainer hook for network namespace info passing to libnetwork's sandbox
2015-09-16 13:55:16 -07:00
Madhu Venugopal e148e763b8 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)
2015-09-16 12:51:14 -04:00