Commit graph

7184 commits

Author SHA1 Message Date
Jessie Frazelle
87a8658eb6 Merge pull request #11353 from mrunalp/override_default_mounts
Filter out default mounts that are being overriden by the user.
2015-03-16 16:40:32 -07:00
Jessie Frazelle
213be9ee27 Merge pull request #11427 from LK4D4/fix_alloc_ip6
Fix IPv6 autoallocation from mac with --ipv6-cidr
2015-03-16 16:38:46 -07:00
Michael Crosby
88f437d6c6 Merge pull request #11402 from miminar/err-cleanup
Error formatting cleanups
2015-03-16 16:13:16 -07:00
Mrunal Patel
7804cd36ee Filter out default mounts that are override by user.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-03-16 18:39:50 -04:00
Alexander Morozov
491f8ab144 Fix IPv6 autoallocation from mac with --ipv6-cidr
We used slice globalIPv6Network.IP itself, not its copy as expected.

Fixes #10774

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-16 15:36:50 -07:00
Michael Crosby
a2fcae41ef Merge pull request #11343 from hqhq/hq_fix_panic_error
fix panic error when docker stats a stopped container
2015-03-16 15:16:03 -07:00
Phil Estes
1705ded1d2 Merge pull request #10792 from larsks/bug/10781
fix various problems with iptables.Exists
2015-03-16 17:39:36 -04:00
Michael Crosby
0c2eb5ebfb Merge pull request #11295 from LK4D4/oom_after_dead
Check oom status after container stopped in lxc driver
2015-03-16 14:16:47 -07:00
Lars Kellogg-Stedman
3559b4177e fix various problems with iptables.Exists
This modifies iptables.Exists so that it must be called with an explicit
table and chain.  This allows us (a) to generate an appropriate command
line for "iptables -C", which was not previously possible, and (b) it
allows us to limit our strings.Contains() search to just the table and
chain in question, preventing erroneous matches against unrelated rules.

Resolves #10781

Signed-off-by: Lars Kellogg-Stedman <lars@redhat.com>
2015-03-16 17:14:45 -04:00
Alexander Morozov
6485d885a0 Merge pull request #11323 from delftswa2014/utils-daemon-windows
Make utils_daemon and volumes.go cross-platform compileable (Windows).
2015-03-16 12:14:30 -07:00
Qiang Huang
8dc5791f73 fix panic error when docker stats a stopped container
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-16 19:55:34 +08:00
Michal Minar
210ab030bc Format error by value
- Use `%v` verb to format errors.
- Give `param` constant in portallocator some better name.

Signed-off-by: Michal Minar <miminar@redhat.com>
2015-03-16 12:05:53 +01:00
Rik Nijessen
1ec2eac50d Make utils_daemon and volumes cross-platform compileable.
Signed-off-by: Rik Nijessen <riknijessen@gmail.com>
2015-03-16 11:46:07 +01:00
Arnaud Porterie
82f390e139 Merge pull request #11076 from hqhq/hq_use_warning_in_sysinfo
use type WARN for warning
2015-03-15 21:13:23 -07:00
Arnaud Porterie
bc7d1d6ef3 Merge pull request #10298 from hqhq/hq_move_resource_to_hostconfig
move resource options from Config to hostConfig
2015-03-15 17:30:46 -07:00
Alexander Morozov
02c1dd899a Merge pull request #10238 from miminar/ephemeral-port-range-allocation
Use system's ephemeral port range for port allocation
2015-03-13 15:18:05 -07:00
Alexander Morozov
bdf3a0295d Fail docker logs on all logging drivers apart from 'json-file'
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-13 15:02:09 -07:00
Alexander Morozov
47a6afb93f Default 'json-file' logging driver and none logging driver
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-13 12:13:21 -07:00
Alexander Morozov
14887e2e1f Interface Logger for logging drivers
Also there is aux datastructure Copier which can copy lines from streams
to Loggers

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-13 11:46:59 -07:00
Darren Shepherd
abb5e9a077 Set labels on container create
Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-03-13 10:02:04 -07:00
Michal Minar
40d5406371 Pass buffered file reader to Fscanf instead of string reader
Unless `file` is wrapped with buffered reader, `fmt.Fscanf` will read
just one byte and terminate with `EOF`.

Signed-off-by: Michal Minar <miminar@redhat.com>
2015-03-13 09:40:53 +01:00
Phil Estes
88c706e442 Merge pull request #11349 from cpuguy83/11132_better_error_message_on_graph_init
Make errors from graphdriver friendlier
2015-03-12 23:26:35 -04:00
Yuan Sun
906974b185 correct some daemon spelling mistakes
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-03-13 05:14:56 -04:00
Brian Goff
c0f7819905 Make errors from graphdriver init friendlier
In several cases graphdriver were just returning the low-level syscall
error and that was making it all the way up to the daemon logs and in
many cases was difficult to tell it was even coming from the graphdriver
at all.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-03-12 08:13:00 -07:00
Jessie Frazelle
c6321931d2 Merge pull request #11326 from cpuguy83/11315_rename_w_daemon_restart
Persist container to disk after rename
2015-03-11 13:44:13 -07:00
Brian Goff
c5c72cf151 Persist container to disk after rename
Fixes #11315

After rename occured the graphdb was updated but the container struct
was never commited back to disk, so on daemon restart it loads the old
name again.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-03-11 12:39:31 -07:00
moxiegirl
d010bf0d99 Merge pull request #11291 from ahmetalpbalkan/info/system-date
Add system time to /info
2015-03-11 09:43:43 -07:00
Deng Guangxing
ce1a0b612d Fix minor typo
Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
2015-03-11 11:13:39 +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
Qiang Huang
bffe04b582 fix warning messages
Use log.Warnf instead of log.Infof, and remove redundant `WARNING` prefix.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-11 08:47:45 +08:00
Ahmet Alp Balkan
2977fd2b7a Add system time to /info
This change adds daemon's system time as RFC3339Nano to the `/info` endpoint
and shows in a more readable format (UnixDate) in `docker -D info` output.

I will be using this to fix the clock skew between the remote test host and
the CI machines running `docker events`-related tests as they're using `--since`
and `--until` and the timestamps are not matching when daemon is not on the
same machine.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-03-10 15:29:05 -07:00
Alexander Morozov
d59212e605 Check oom status after container stopped in lxc driver
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-10 13:45:13 -07:00
Jessie Frazelle
e4b753c1de Merge pull request #11211 from cpuguy83/ensure_engine_shutdown
Ensure clean engine shutdown on startup errors
2015-03-10 12:13:35 -07:00
Alexander Morozov
821ec8334f Setup user groups in lxc driver
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-10 09:43:11 -07:00
Alexander Morozov
c8c11bfc36 Use CgroupString instead of missing GetCgroupAllowString in lxc_template
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-10 08:50:03 -07:00
Jessie Frazelle
2fb89b2e2c Merge pull request #11208 from LK4D4/new_libcontainer_api
New libcontainer api
2015-03-10 07:50:19 -07:00
Michal Minar
0dcc970432 Restructured port range loader
And renamed `GetPortRange` to `PortRange`.

Signed-off-by: Michal Minar <miminar@redhat.com>
2015-03-10 10:02:43 +01:00
Michal Minar
fcf8e85a35 Use default port range in unit tests
Signed-off-by: Michal Minar <miminar@redhat.com>
2015-03-09 16:58:14 +01:00
Brian Goff
0e3f2f2ac0 Ensure clean engine shutdown on startup errors
Previously on error either from the daemon or from the api it is just
exiting with exit status 1 but not performing a shutdown.
This can produce insconsistent state depending on where the error came
from.

This makes sure that before we exit on error that the engine gets fully
shutdown.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-03-09 08:40:38 -04:00
Michal Minar
0eb3544c43 Use system's ephemeral port range for port allocation
Read `/proc/sys/net/ipv4/ip_local_port_range` kernel parameter to obtain
ephemeral port range that now sets the boundaries of port allocator
which finds free host ports for those exported by containers.

Signed-off-by: Michal Minar <miminar@redhat.com>
2015-03-09 09:13:20 +01:00
Arnaud Porterie
89bdaa35e0 Remove subdirectories MAINTAINERS files
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-06 18:21:51 -08:00
Alexander Morozov
68ba5f0b69 Execdriver implementation on new libcontainer API
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-06 14:46:58 -08:00
Zhang Wentao
06a40f0f28 docker info display http/https_proxy setting
Signed-off-by: Zhang Wentao <zhangwentao234@huawei.com>
2015-03-06 09:02:21 +08:00
Michael Crosby
92e632c84e Merge pull request #11064 from delftswa2014/10970-treesize
Move directory size calculation to pkg/ (fixes #10970)
2015-03-05 13:06:02 -08:00
Dan Walsh
4eb2fd169f Two SELinux Changes.
daemon/volumes.go

  This SetFileCon call made no sense, it was changing the labels of any
directory mounted into the containers SELinux label.  If it came from me,
then I apologize since it is a huge bug.

The Volumes Mount code should optionally do this, but it should not always
happen, and should never happen on a --privileged container.

The change to

daemon/graphdriver/vfs/driver.go, is a simplification since this it not
a relabel, it is only a setting of the shared label for docker volumes.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-03-05 13:55:44 -05:00
Phil Estes
214eae6f53 Merge pull request #11163 from duglin/RmiTest
Better error message for `docker rmi ''`
2015-03-05 09:49:46 -05:00
Sven Dowideit
4e5ea0c875 Seems like an un-necessary if statement
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-03-04 13:24:17 -08:00
Doug Davis
eeb36c9348 Better error message for "docker rmi ''"
See: https://github.com/docker/docker/issues/10867

While looking at #10867 I noticed that the error message generated for
a blank image ID wasn't very helpful so this fixes that.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-04 13:21:59 -08:00
Martijn Dwars
e2b8933d21 Move directory size calculation to pkg/ (fixes #10970)
Signed-off-by: Martijn Dwars <ikben@martijndwars.nl>
2015-03-04 21:16:31 +01:00
Jessie Frazelle
7b3ffd5cc0 Merge pull request #10586 from resouer/10532-fix-cors-hardcode
Fix 10532 to change --api-enable-cors to string.
2015-03-04 18:42:20 +00:00