Commit graph

242 commits

Author SHA1 Message Date
Alexander Morozov
d4a8d09d1a Do not rely on string comparison in truncindex
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-11-04 11:34:05 -08:00
David Calavera
63efc12070 Remove further references to the daemon within containers.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-04 12:28:54 -05:00
David Calavera
ca5ede2d0a Decouple daemon and container to log events.
Create a supervisor interface to let the container monitor to emit events.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-04 12:27:48 -05:00
David Calavera
2c72015ce3 Decouple daemon and container to manage volumes.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-04 12:27:48 -05:00
David Calavera
3a49765046 Decouple daemon and container to mount and unmount filesystems.
Side effects:
- Decouple daemon and container to start containers.
- Decouple daemon and container to copy files.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-04 12:27:47 -05:00
Alexander Morozov
7aa28b6bdd Fix go vet warnings
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-11-02 08:28:34 -08:00
John Howard
a7e686a779 Windows: Add volume support
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-22 10:42:53 -07:00
Kun Zhang
0ff3123eba volume create error on conflict option
Signed-off-by: Kun Zhang <zkazure@gmail.com>
2015-10-12 11:16:39 +08:00
Tibor Vass
e0ef11a4c2 Abstract builder and implement server-side dockerfile builder
This patch creates interfaces in builder/ for building Docker images.
It is a first step in a series of patches to remove the daemon
dependency on builder and later allow a client-side Dockerfile builder
as well as potential builder plugins.

It is needed because we cannot remove the /build API endpoint, so we
need to keep the server-side Dockerfile builder, but we also want to
reuse the same Dockerfile parser and evaluator for both server-side and
client-side.

builder/dockerfile/ and api/server/builder.go contain implementations
of those interfaces as a refactoring of the current code.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-10-06 19:10:19 -04: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
Tibor Vass
79c31f4b13 Revert "Merge pull request #16567 from calavera/context_per_request"
This reverts commit ff92f45be4, reversing
changes made to 80e31df3b6.

Reverting to make the next revert easier.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-09-29 13:40:46 -04:00
Jess Frazelle
ff92f45be4 Merge pull request #16567 from calavera/context_per_request
Define a context per request.
2015-09-25 13:01:51 -07:00
Morgan Bauer
93bd57b0b2
refactor create to not expose internal data structures
- use existing exposed type

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
2015-09-25 09:35:18 -07:00
David Calavera
27c76522de Define a context per request.
Avoid creating a global context object that will be used while the daemon is running.

Not only this object won't ever be garbage collected, but it won't ever be used for anything else than creating other contexts in each request. I think it's a bad practive to have something like this sprawling aroud the code.

This change removes that global object and initializes a context in the cases we don't have already one, like shutting down the server.
This also removes a bunch of context arguments from functions that did nothing with it.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-24 18:44:53 -04: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
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
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
David Calavera
2c6c07752c 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>
2015-09-14 16:16:46 -04:00
Brian Goff
9ca4aa4797 Merge pull request #15798 from calavera/volume_driver_host_config
Move VolumeDriver to HostConfig to make containers portable.
2015-09-08 22:05:40 -04:00
Ma Shimiao
73d8af9319 before adjusting should check whether need return or not
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-09-07 11:09:39 +08:00
David Calavera
6549d6517b Move VolumeDriver to HostConfig to make containers portable.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-04 12:42:44 -04:00
Lei Jitang
16220e0681 Minor fix: remove redundant tag name in error message of create failed.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-08-30 10:43:33 +08:00
Morgan Bauer
abd72d4008
golint fixes for daemon/ package
- some method names were changed to have a 'Locking' suffix, as the
 downcased versions already existed, and the existing functions simply
 had locks around the already downcased version.
 - deleting unused functions
 - package comment
 - magic numbers replaced by golang constants
 - comments all over

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
2015-08-27 22:07:42 -07:00
Brian Goff
b3b7eb2723 Add volume API/CLI
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-08-26 13:37:52 -04:00
David Calavera
6f8c4480e4 Merge pull request #14665 from coolljt0725/fix_build_with_resource_limit
Fix build with resource limit which system not support.
2015-08-25 16:42:13 +02:00
Jessie Frazelle
19f7bfcda9 Merge pull request #15507 from clintonskitson/patch_issue_15467
added check for bind on create to determine local volume driver
2015-08-21 14:23:44 -07:00
Clinton Kitson
6b8129d1fe added check for bind on create to determine local volume driver
Signed-off-by: Clinton Kitson <clintonskitson@gmail.com>
2015-08-20 01:40:04 -07:00
Lei Jitang
770daa15f3 Fix build with resource limit which system is not support.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-08-18 11:54:00 +08:00
Zhang Kun
1ed15550f5 fix in daemon side
Signed-off-by: Zhang Kun <zkazure@gmail.com>

goformat

Signed-off-by: Zhang Kun <zkazure@gmail.com>

fix small

Signed-off-by: Zhang Kun <zkazure@gmail.com>

change to rm

Signed-off-by: Zhang Kun <zkazure@gmail.com>

handler other error

Signed-off-by: Zhang Kun <zkazure@gmail.com>

unique ERR

Signed-off-by: Zhang Kun <zkazure@gmail.com>

setHostConfig_fail_test

Signed-off-by: Zhang Kun <zkazure@gmail.com>

format

Signed-off-by: Zhang Kun <zkazure@gmail.com>

err handle and modify test

Signed-off-by: Zhang Kun <zkazure@gmail.com>

golint error

Signed-off-by: Zhang Kun <zkazure@gmail.com>
2015-08-18 10:06:36 +08:00
Lei Jitang
08b3dc8d9f Adapt container settings after verify platform container settings.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-08-06 19:56:51 +08:00
Tibor Vass
3273209a9c Merge pull request #15075 from hqhq/hq_move_cpushare_change
Cleanup: Merge adjustCpuShares to adoptContainerSettings
2015-08-05 21:53:58 -04:00
Lei
6a0050d0f0 Remove redundant ip_forward check
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-08-06 09:06:31 +08:00
Qiang Huang
e0af23dc18 Cleanup: Merge adjustCPUShares to adoptContainerSettings
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-08-06 08:15:14 +08:00
Aaron Lehmann
d4836cd7ec Documentation improvements and code cleanups for graph package
Expand the godoc documentation for the graph package.

Centralize DefaultTag in the graphs/tag package instead of defining it
twice.

Remove some unnecessary "config" structs that are only used to pass
a few parameters to a function.

Simplify the GetParentsSize function - there's no reason for it to take
an accumulator argument.

Unexport some functions that aren't needed outside the package.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-30 14:27:10 -07:00
Srini Brahmaroutu
1d6e443119 /graph fix lin errors/warnings
Addresses #14756
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-07-29 20:59:36 +00:00
John Howard
47c56e4353 Windows: Factoring out unused fields
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-27 17:44:18 -07:00
Jessie Frazelle
6e1d887722 Merge pull request #13834 from hqhq/hq_memswap_change
Set default MemorySwap on Docker side
2015-07-27 10:46:10 -07:00
John Howard
9001ea26e7 Fixing Image struct to no longer use Graph.
Signed-off-by:  John Howard <jhoward@microsoft.com>
2015-07-20 13:59:53 -07:00
Alexander Morozov
c86189d554 Update libcontainer
Replaced github.com/docker/libcontainer with
github.com/opencontainers/runc/libcontaier.
Also I moved AppArmor profile generation to docker.

Main idea of this update is to fix mounting cgroups inside containers.
After updating docker on CI we can even remove dind.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-16 16:02:26 -07:00
Qiang Huang
7e0dfbf4cd Set default MemorySwap on Docker side
As discussed in docker/libcontainer#616,
we should move this behavior to Docker side.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-13 15:17:43 +08:00
John Howard
52f4d09ffb Windows: Graph driver implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-10 14:33:11 -07:00
Qiang Huang
af7f81878f Show error message when todisk failed
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-02 18:24:35 +08:00
Lei Jitang
b37832e353 Add verify config to verifyContainerSettings
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-06-13 09:31:19 +08:00
Arnaud Porterie
00b8fec75f Merge pull request #13773 from dmcgowan/refactor-1-image-graph-separation
refactor: separate graph from image
2015-06-11 17:44:37 -07:00
Lei Jitang
67552fb22d Cleanup: remove some useless code and change verifyHostConfig to verifyContainerSetting
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-06-08 09:06:58 +08:00
Antonio Murdaca
4ce817796e Avoid nil pointer dereference while creating a container with an empty Config
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-06-06 20:07:32 +02:00
Derek McGowan
2b58b677a5 Separate graph from image
Move graph related functions in image to graph package.
Consolidating graph functionality is the first step in refactoring graph into an image store model.
Subsequent refactors will involve breaking up graph into multiple types with a strongly defined interface.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-06-05 18:06:09 -07:00
Doug Davis
8232312c1e Cleanup container LogEvent calls
Move some calls to container.LogEvent down lower so that there's
less of a chance of them being missed. Also add a few more events
that appear to have been missed.

Added testcases for new events: commit, copy, resize, attach, rename, top

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-06-01 12:39:28 -07:00
Antonio Murdaca
15134a3320 Remove PortSpecs from Config
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-29 22:38:09 +02:00
Lei Jitang
bcd076b5fe Clean up: remove redundant '\n' in Create
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-28 17:08:55 +08:00
Brian Goff
b2a43baf2e Use SELinux labels for volumes
Fixes a regression from the volumes refactor where the vfs graphdriver
was setting labels for volumes to `s0` so that they can both be written
to by the container and shared with other containers.
When moving away from vfs this was never re-introduced.
Since this needs to happen regardless of volume driver, this is
implemented outside of the driver.

Fixes issue where `z` and `Z` labels are not set for bind-mounts.

Don't lock while creating volumes

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-27 13:43:38 -07:00
Arnaud Porterie
bce3e761c0 Merge pull request #13161 from calavera/plugin_discovery
Proposal: Volume refactor and external volume plugins
2015-05-23 18:44:18 -07:00
David Calavera
d592778f4a Propagate unmount events to the external volume drivers.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-22 16:43:34 -07:00
Qiang Huang
84aae5a226 Don't check running container at create time
We should let user create container even if the container he wants
join is not running, that check should be done at start time.

In this case, the running check is done by getIpcContainer() when
we start container.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-23 07:15:14 +08:00
Arnaud Porterie
2653c7c16c Make API volume-driver dependent on 'experimental'
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-21 20:34:17 -07:00
David Calavera
81fa9feb0c Volumes refactor and external plugin implementation.
Signed by all authors:

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Jeff Lindsay <progrium@gmail.com>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Signed-off-by: Luke Marsden <luke@clusterhq.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-21 20:34:17 -07:00
Qiang Huang
a2f39e7754 Fix oom kill disable issue
It should not be hard limit, we should only check oom kill disable
when user using it.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-10 14:55:00 +08:00
HuKeping
a4a924e1b6 Feature: option for disable OOM killer
Add cgroup support for disable OOM killer.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-05-04 21:11:29 +08:00
John Howard
03eb0d065d Windows: Move workdir check daemon-side
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-04-30 14:16:45 -07:00
Ma Shimiao
93cdb0071b optimize code to clarify logic
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-04-16 19:56:25 +08:00
David Calavera
767df67e31 Decode container configurations into typed structures.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-15 10:22:07 -07:00
David Calavera
98996a432e Remove engine.Job from Create action.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-14 15:33:12 -07:00
David Calavera
610c436e07 Remove engine.Job from Start action.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-14 15:33:12 -07:00
Lei Jitang
013fb87543 Fix error from daemon no such image even when the image exist
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-03-28 09:07:20 +08:00
Qiang Huang
40ef253ef5 add back job.Errorf
c79b9bab54 (Remove engine.Status and replace it with standard go error)
cause a regression that create container won't get any warnings, we still
need this to send useful informations to user.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-26 13:12:36 +08:00
Antonio Murdaca
c79b9bab54 Remove engine.Status and replace it with standard go error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-25 22:32:08 +01:00
Qiang Huang
55cc166e53 do not warning when we disable memoryswap
$ docker run -ti --rm -m 300M --memory-swap=-1 ubuntu:14.04
WARNING: Your kernel does not support swap limit capabilities. Limitation discarded.
root@813aafc019d5:/#

When we disable memoryswap, it should not warning swap limit not support.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-18 10:08:17 +08:00
Ma Shimiao
703cab12e7 fix not show error when using --lxc-conf without lxc driver
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-03-17 08:50:17 +08:00
Qiang Huang
837eec064d move resources from Config to HostConfig
Cgroup resources are host dependent, they should be in hostConfig.

For backward compatibility, we just copy it to hostConfig, and leave it in
Config for now, so there is no regressions, but the right way to use this
throught json is to put it in HostConfig, like:
  {
      "Hostname": "",
      ...
      "HostConfig": {
	  "CpuShares": 512,
          "Memory": 314572800,
          ...
      }
  }

As we will add CpusetMems, CpusetCpus is definitely a better name, but some
users are already using Cpuset in their http APIs, we also make it compatible.

The main idea is keep using Cpuset in Config Struct, and make it has the same
value as CpusetCpus, but not always, some scenarios:
 - Users use --cpuset in docker command, it can setup cpuset.cpus and can
   get Cpuset field from docker inspect or other http API which will get
   config info.
 - Users use --cpuset-cpus in docker command, ditto.
 - Users use Cpuset field in their http APIs, ditto.
 - Users use CpusetCpus field in their http APIs, they won't get Cpuset field
   in Config info, because by then, they should already know what happens
   to Cpuset.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-11 09:31:18 +08:00
Alexander Morozov
6efecb7b41 Merge pull request #10186 from rhatdan/selinux-build
Turn on Security opts including labeling for docker build
2015-02-06 14:11:21 -08:00
Michael Crosby
34c804a139 Merge pull request #9705 from acbodine/9311-truncindex-error-duplicate-id-on-ambiguous-id
Closes #9311 Handles container id/name collisions against daemon functionalities according to #8069
2015-02-06 14:01:28 -08:00
Dan Walsh
8a8dcf1930 Turn on Security opts including labeling for docker build
Currently docker build is not passing HostConfig to daemon.Create.
this patch creates the default HostConfig and passes it to daemon.Create.
This will cause the SELinux labeling to turn on for docker build.  Basically
it causes a SecurtyOpt field to be created.  In the future this might also
allow us to use seccomp and UserNamespace with docker build.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-02-05 12:33:22 +01:00
Qiang Huang
72f356be6a add check for memoryswap when create
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-02-05 09:05:27 +08:00
Andrew C. Bodine
d25a65375c Closes #9311 Handles container id/name collisions against daemon functionalities according to #8069
Signed-off-by: Andrew C. Bodine <acbodine@us.ibm.com>
2015-01-21 17:11:31 -08:00
Dan Walsh
23feaaa240 Allow the container to share the PID namespace with the host
We want to be able to use container without the PID namespace.  We basically
want containers that can manage the host os, which I call Super Privileged
Containers.  We eventually would like to get to the point where the only
namespace we use is the MNT namespace to bring the Apps userspace with it.

By eliminating the PID namespace we can get better communication between the
host and the clients and potentially tools like strace and gdb become easier
to use.  We also see tools like libvirtd running within a container telling
systemd to place a VM in a particular cgroup, we need to have communications of the PID.

I don't see us needing to share PID namespaces between containers, since this
is really what docker exec does.

So currently I see us just needing docker run --pid=host

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-01-13 16:35:17 -08:00
Sebastiaan van Stijn
5f699a465d Fix typo in error-message.
This fixes a small typo in the errormessage for memory-swap.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2015-01-12 21:48:44 +01:00
Alexander Morozov
748b7459b3 Merge pull request #9603 from hqhq/hq_add_memory_swap
add support to set MemorySwap
2015-01-06 10:09:21 -08:00
Josh Hawn
8936789919 Make FROM scratch a special cased 'no-base' spec
There has been a lot of discussion (issues 4242 and 5262) about making
`FROM scratch` either a special case or making `FROM` optional, implying
starting from an empty file system.

This patch makes the build command `FROM scratch` special cased from now on
and if used does not pull/set the the initial layer of the build to the ancient
image ID (511136ea..) but instead marks the build as having no base image. The
next command in the dockerfile will create an image with a parent image ID of "".
This means every image ever can now use one fewer layer!

This also makes the image name `scratch` a reserved name by the TagStore. You
will not be able to tag an image with this name from now on. If any users
currently have an image tagged as `scratch`, they will still be able to use that
image, but will not be able to tag a new image with that name.

Goodbye '511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158',
it was nice knowing you.

Fixes #4242

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2014-12-18 14:03:38 -08:00
Qiang Huang
1a9b640e0d add support to set MemorySwap
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2014-12-10 16:53:43 -08:00
Jessie Frazelle
67fda33197 Merge pull request #9089 from cpuguy83/8942_create_volumes_on_create
Initialize volumes when container is created
2014-12-03 15:42:09 -08:00
Blake Geno
9200fdd197 remove obsolete workaround
Signed-off-by: Blake Geno <blakegeno@gmail.com>
2014-12-01 11:44:13 -05:00
Michael Crosby
294843ef23 Move security opts to HostConfig
These settings need to be in the HostConfig so that they are not
committed to an image and cannot introduce a security issue.

We can safely move this field from the Config to the HostConfig
without any regressions because these settings are consumed at container
created and used to populate fields on the Container struct.  Because of
this, existing settings will be honored for containers already created
on a daemon with custom security settings and prevent values being
consumed via an Image.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Conflicts:
	daemon/create.go
		changing config to hostConfig was required to fix the
		 build
2014-11-25 01:02:30 +02:00
Brian Goff
7107898d5c Initialize volumes when container is created
Fixes #8942
Current behavior is that volumes aren't initialized until start.
Volumes still need to be initialized on start since VolumesFrom and
Binds can be passed in as part of HostConfig on start, however anything
that's already been initialized will just be skipped as is the current
behavior.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2014-11-14 11:37:03 -05:00
Dan Walsh
497fc8876e Allow IPC namespace to be shared between containers or with the host
Some workloads rely on IPC for communications with other processes.  We
would like to split workloads between two container but still allow them
to communicate though shared IPC.

This patch mimics the --net code to allow --ipc=host to not split off
the IPC Namespace.  ipc=container:CONTAINERID to share ipc between containers

If you share IPC between containers, then you need to make sure SELinux labels
match.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-11-12 11:29:58 -05:00
Andrea Luzzardi
5b8379a434 Disable stable IPs.
Stable IPs causes some regressions in the way people use Docker, see GH#8493.

Reverting it for 1.3, we'll enable it back for the next release.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2014-10-09 15:15:17 -07:00
Andrea Luzzardi
a487593729 Stable Networking: Keep the same network settings across container restarts.
This change will allocate network settings (IP and public ports) at
container creation rather than start and keep them throughout the
lifetime of the container (i.e. until it gets destroyed) instead of
discarding them when the container is stopped.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2014-10-03 13:46:24 -07:00
Andrea Luzzardi
1df87b9506 API: Provide the HostConfig during "run".
Currently, the HostConfig is only passed from the CLI to Docker only
when issuing a docker create, but not when doing a docker run.

In the near future, in order to allocate ports at creation time rather
than start time, we will need to have the HostConfig readily available
at container creation.

This PR makes the client always pass the HostConfig when creating a
container (regardless of whether it's for a run or create).

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2014-09-25 15:24:38 -07:00
Michael Crosby
9b755412ab Update memory limit for container
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-09-22 21:41:14 +00:00
Alexander Larsson
3a90004f3c Add "docker create" support
This exposes the already existing "create container" operation.  It is
very similar to "docker run -d" except it doesn't actually start the
container, but just prepares it. It can then be manually started using
"docker start" at any point.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)

Conflicts:
	api/client/commands.go
	runconfig/parse.go
	server/container.go

Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-09-16 18:40:24 -04:00
Solomon Hykes
2a39635d30 Cleanup: move image depth checks in image/
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-15 00:43:12 +00:00
Alexandr Morozov
8d056423f8 Separate events subsystem
* Events subsystem merged from `server/events.go` and
  `utils/jsonmessagepublisher.go` and moved to `events/events.go`
* Only public interface for this subsystem is engine jobs
* There is two new engine jobs - `log_event` and `subscribers_count`
* There is auxiliary function `container.LogEvent` for logging events for
  containers

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
[solomon@docker.com: resolve merge conflicts]
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 10:08:19 +00:00
Solomon Hykes
80f3272ee9 Move "create" to daemon/create.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:16:50 -04:00