Граф коммитов

343 Коммитов

Автор SHA1 Сообщение Дата
Tibor Vass 500a314713 Merge pull request #15179 from Microsoft/10662-yetmoretodos
Windows: Tidy verifyContainerSettings
2015-07-30 23:58:16 -04:00
John Howard 3fea79bfd8 Windows: Address more todos
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-30 15:28:11 -07:00
Kir Kolyshkin a83a769347 Simplify and fix os.MkdirAll() usage
TL;DR: check for IsExist(err) after a failed MkdirAll() is both
redundant and wrong -- so two reasons to remove it.

Quoting MkdirAll documentation:

> MkdirAll creates a directory named path, along with any necessary
> parents, and returns nil, or else returns an error. If path
> is already a directory, MkdirAll does nothing and returns nil.

This means two things:

1. If a directory to be created already exists, no error is returned.

2. If the error returned is IsExist (EEXIST), it means there exists
a non-directory with the same name as MkdirAll need to use for
directory. Example: we want to MkdirAll("a/b"), but file "a"
(or "a/b") already exists, so MkdirAll fails.

The above is a theory, based on quoted documentation and my UNIX
knowledge.

3. In practice, though, current MkdirAll implementation [1] returns
ENOTDIR in most of cases described in #2, with the exception when
there is a race between MkdirAll and someone else creating the
last component of MkdirAll argument as a file. In this very case
MkdirAll() will indeed return EEXIST.

Because of #1, IsExist check after MkdirAll is not needed.

Because of #2 and #3, ignoring IsExist error is just plain wrong,
as directory we require is not created. It's cleaner to report
the error now.

Note this error is all over the tree, I guess due to copy-paste,
or trying to follow the same usage pattern as for Mkdir(),
or some not quite correct examples on the Internet.

[v2: a separate aufs commit is merged into this one]

[1] https://github.com/golang/go/blob/f9ed2f75/src/os/path.go

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2015-07-30 11:48:08 -07:00
Alexander Morozov 6bca8ec3c9 Replace GenerateRandomID with GenerateNonCryptoID
This allow us to avoid entropy usage in non-crypto critical places.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-28 22:31:01 -07: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
gs11 547d6c6656 Clarify error message when container name is already in use. Signed-off-by: Gustav Sinder <gustav.sinder@gmail.com>
Signed-off-by: gs11 <gustav.sinder@gmail.com>
2015-07-25 14:08:38 +02:00
Dan Walsh 4815fdc334 Merge branch 'master' of github.com:docker/docker into error
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-07-22 08:06:19 -04:00
Dan Walsh 96a4469835 If a user hits this error it would be helpful to know tagstore name.
There are several bug reports on this error happening, and error is
not helpful unless you read the code.  Google brings up removing
the repositories.btrfs file.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-07-21 09:26:27 -04: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
Roman Strashkin cc955ae73c added ability to iterate over all indexes and use index.Iterate() instead of ReadDir() to walk over the graph
Signed-off-by: Roman Strashkin <roman.strashkin@gmail.com>
2015-07-07 22:13:28 +03:00
John Howard 62a75fca68 Windows: Move daemon check back centrally
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-11 12:42:46 -07:00
John Howard 52f4d09ffb Windows: Graph driver implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-10 14:33:11 -07:00
Jessie Frazelle 382799a642 Merge pull request #14476 from crosbymichael/execid-growth-fix
Prevent uncontrolled exec config growth
2015-07-09 15:36:11 -07:00
Alexander Morozov 96bc377a8d Check dockerinit only if lxc driver is used
This allow you to run dynamically linked docker without compiling
dockerinit.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-08 14:12:51 -07:00
Michael Crosby 5f017bba48 Add GC loop to clean exec command refs on daemon
This adds an event loop for running a GC cleanup for exec command
references that are on the daemon.  These cannot be cleaned up
immediately because processes may need to get the exit status of the
exec command but it should not grow out of bounds.  The loop is set to a
default 5 minute interval to perform cleanup.

It should be safe to perform this cleanup because unless the clients are
remembering the exec id of the process they launched they can query for
the status and see that it has exited.  If they don't save the exec id
they will have to do an inspect on the container for all exec instances
and anything that is not live inside that container will not be returned
in the container inspect.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-07-08 13:47:59 -07:00
John Howard f4b08c7f5e Windows: Win32 event for sigusr1 linux equivalence
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-06 18:58:53 -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
Madhu Venugopal c9328c6ccf fixed incorrect assumption on --bridge=none treated as disable network
libnetwork host, none and bridge driver initialization is incorrectly
disabled if the daemon flag --bridge=none. The expected behavior of
setting --bridge as none is to disable the bridge driver alone and let
all other modes to be operational.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-30 13:04:28 -07:00
David Calavera 18d5d3ba03 Merge pull request #14133 from Microsoft/10662-netmode
Windows: Refactor network modes
2015-06-29 15:02:42 -07:00
John Howard c5e6a4b307 Windows: Refactor network modes
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-29 13:13:55 -07:00
David Calavera 2d15b35f7a Merge pull request #14120 from mdavranche/tempDir
tempDir (in the root dir), must be created after the root dir.
2015-06-26 11:46:55 -07:00
Chun Chen b0b2f979c7 Set exit code of old running container as 137
Signed-off-by: Chun Chen <chenchun.feed@gmail.com>
2015-06-25 22:30:09 +08:00
root 41f69883d2 tempDir (in the root dir), must be created after the root dir.
Signed-off-by: mikael.davranche <mikael.davranche@corp.ovh.net>
2015-06-23 14:53:18 +02:00
John Howard 9d0ed1dea0 Windows: Fix cgroup regression
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-19 15:29:47 -07:00
Brian Goff 9b05aa6ee8 cleanup sysinfo package
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-17 20:41:14 -04:00
Brian Goff 49834e8d59 Fix circular import for windows vfs graphdriver
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-16 09:08:10 -04:00
Michael Crosby ff4e58ff56 Get Mtu from default route
If no Mtu value is provided to the docker daemon, get the mtu from the
default route's interface.  If there is no default route, default to a
mtu of 1500.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-06-15 16:33:02 -07:00
David Calavera 0964a664e8 Cleanup driver and graph db after stopping containers.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-10 16:11:50 -07:00
John Howard 8fb0ca2c35 Windows: Refactor daemon
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-10 12:42:43 -07:00
Arnaud Porterie 55bdb51659 Merge pull request #13699 from calavera/volume_backwards
Allow to downgrade local volumes from > 1.7 to 1.6.
2015-06-09 19:51:06 -07:00
David Calavera bd9814f0db Allow to downgrade local volumes from > 1.7 to 1.6.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-09 18:04:59 -07:00
Michael Crosby 4750e1f77e Merge pull request #13784 from mrjana/cnm_integ
libnetwork: Add garbage collection trigger
2015-06-09 17:24:30 -07:00
Ma Shimiao 73bc885b23 daemon: cleanup getting container logic
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-06-09 14:47:07 +08:00
Jana Radhakrishnan c68e7f96f9 libnetwork: Add garbage collection trigger
When the daemon is going down trigger immediate
garbage collection of libnetwork resources deleted
like namespace path since there will be no way to
remove them when the daemon restarts.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-07 21:33:51 -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
Eric-Olivier Lamey 5fa60149e2 Restore --default-gateway{,-v6} daemon options.
This was added before the libnetwork merge, and then lost. Fixes #13755.

Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
2015-06-05 06:21:22 +00:00
David Calavera 04c6f09fbd Merge pull request #12400 from coolljt0725/kill_all_containers_on_daemon_shutdown
Ensure all the running containers are killed on daemon shutdown
2015-05-29 16:45:57 -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
David Calavera 53d9609de4 Mount bind volumes coming from the old volumes configuration.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-28 14:06:17 -07: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
Lei Jitang bdb77078b5 Ensure all the running containers are killed on daemon shutdown
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-27 09:09:25 +08:00
Darren Shepherd 59214a0737 Preinitialize MountPoints to avoid assigning to a nil map
Fixes #13435

Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-05-25 19:37:57 -07: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
Jana Radhakrishnan d18919e304 Docker integration with libnetwork
- Updated Dockerfile to satisfy libnetwork GOPATH requirements.
    - Reworked daemon to allocate network resources using libnetwork.
    - Reworked remove link code to also update network resources in libnetwork.
    - Adjusted the exec driver command population to reflect libnetwork design.
    - Adjusted the exec driver create command steps.
    - Updated a few test cases to reflect the change in design.
    - Removed the dns setup code from docker as resolv.conf is entirely managed
      in libnetwork.
    - Integrated with lxc exec driver.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-19 22:40:19 +00:00
Arnaud Porterie 0cc5da0635 Merge pull request #12884 from Microsoft/10662-startcontainerrefactor
Windows: Refactor container
2015-05-19 10:44:23 -07:00
John Howard b9e4b95788 Windows: Refactor container
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-16 12:38:20 -07:00
Antonio Murdaca 624bf81fdb Add RestartPolicy methods instead of using strings checking
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-16 14:15:28 +02:00
Shishir Mahajan 8b2c6cb072 root dir for execdriver (/var/run/docker) should be configurable
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2015-05-15 09:30:36 -04:00