Commit Graph

206 Commits

Author SHA1 Message Date
fef7b9ee0d Fix panic for DOCKER_HOST without ://
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 660cc4a2675d34695406b2506344a2a18f2a59e9
Component: engine
2014-08-26 20:32:10 +04:00
fc0d245526 Move remote API config out of daemon/
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 1d10c55aec891df609d36c90ee6c30adb24c16c4
Component: engine
2014-08-13 19:25:51 +00:00
506b7bed3d Check for conflicting daemon config options in NewDaemon
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 1eba59eb249b14a0499a52495be2c27b5afc4749
Component: engine
2014-08-13 19:25:51 +00:00
13ed6ae5e4 opts.IPVal returns an error on incorrect input
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: ca11b77471bd3a99b4dbc44b716675ba8174306c
Component: engine
2014-08-13 19:25:51 +00:00
9a4f8cadf4 Parse daemon configuration in daemon.Config.InstallFlags instead of main
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 353b7c8ec77b30fa83dac5ec0778193f6de8b437
Component: engine
2014-08-13 19:25:51 +00:00
8bd8c43b79 Helpers to parse lists, IPs, hosts, dns searches from the command line
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 6200002669874f3314856527fecd0c004060913c
Component: engine
2014-08-13 19:25:47 +00:00
ec374f9227 Move daemonconfig into daemon
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: a4befff533cf786df7a4da29798984ebb2268d8c
Component: engine
2014-08-13 19:09:51 +00:00
d27f6d0c6d Remove deprecated server/ package
Victory!

Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 63503cafe4addb7d275244fbcce0e10d67225cc9
Component: engine
2014-08-13 06:56:45 +00:00
7d5baeee4d Merge pull request #7490 from crosbymichael/reexec
Use argv0 as reexec implementation for dockerinit
Upstream-commit: 01995ebebb3f26a2bd1e1131b5794e8b6b6ae18e
Component: engine
2014-08-11 18:43:34 -07:00
2fbe59b1d9 Use argv0 as reexec implementation for dockerinit
This changes the way the exec drivers work by not specifing a -driver
flag on reexec.  For each of the exec  drivers they register their own
functions that will be matched aginst the argv 0 on exec and called if
they match.

This also allows any functionality to be added to docker so that the
binary can be reexec'd and any type of function can be called.  I moved
the flag parsing on docker exec to the specific initializers so that the
implementations do not bleed into one another.  This also allows for
more flexability within reexec initializers to specify their own flags
and options.

Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: 73210671764fc3de133a627205582e069e1ff43d
Component: engine
2014-08-11 11:47:21 -07:00
301a2b811c Rename a method for clarity
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: a110ce2f284d09df3e047b1999a1535770433d5f
Component: engine
2014-08-10 04:33:19 +00:00
c8882ce911 Remove unnecessary job "initserverpidfile"
That job was a hacky solution to a real race condition. This removes the
hack without re-introducing the race.

Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: b4efcd53e0a62a8ce1080e94e28358ac1a2d6ae2
Component: engine
2014-08-06 17:56:11 +00:00
727879ad53 Cleanup: refactor shutdown and signal handling facility
This disentangles the following functions, which were previously all mixed together:

* 1) Waiting for jobs to terminate when shutting down
* 2) Handling signals in the Docker daemon
* 3) Per-subsystem cleanup handlers
* 4) pidfile management

Responsibilities are dispatched as follows:

* Signal traps are set in `main`, and trigger `engine.Shutdown`
* `engine.Shutdown` coordinates cleanup by waiting for jobs to complete, and calling shutdown handlers
* To perform cleanup at shutdown, each subsystem registers handlers with `engine.OnShutdown`
* `daemon` is one subsystem, so it registers cleanup via `engine.OnShutdown`.
* `daemon` owns the pidfile, which is used to lock access to `/var/lib/docker`. Part of its cleanup is to remove the pidfile.

Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: c9f3fd3fc7a4beb97de40ef8da7330b23397d9d3
Component: engine
2014-08-06 17:56:11 +00:00
3b38f1694c Rename DOCKER_CONFIG envvar to DOCKER_CERT_PATH
DOCKER_CONFIG was introduced in #6984.

We may use "config" for other purposes (e.g. #7232). Until we
have made a design decision around how configuration files will
work, DOCKER_CERT_PATH is a much safer name to rely on for future
compatibility.

Docker-DCO-1.1-Signed-off-by: Ben Firshman <ben@firshman.co.uk> (github: bfirsh)
Upstream-commit: a49de2c46713149053b0ee25313c6f7a39273c25
Component: engine
2014-08-04 17:36:53 -07:00
309f9edb73 Add a "daemon" build tag and toggle it with the already-existing "DOCKER_CLIENTONLY" build variable
This works mostly by refactoring our "main" package to be careful about what it imports based on the daemon build tag. :)

Also, I've updated Travis to test "client-only" compilation after it tests the daemon version.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: 1b95590d06b20b79041f6d23b9bc35612b82cb51
Component: engine
2014-08-04 15:05:12 -06:00
409af56c06 Move kernel version/capabilities detection to NewDaemon
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 4949e070fbcac1ef9fbeabe59e3f39cdb830e5fd
Component: engine
2014-07-30 09:26:51 +00:00
f3b5291fed Move canonical root path detection to NewDaemon
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: e92a9e0b53d296f6e0caa925a56ebbd76b20acaa
Component: engine
2014-07-30 09:26:51 +00:00
504ecb28ba Move TMPDIR symlink cleanup to NewDaemon
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: a7d8c732b1760fcb3d5fb99c035a34123809e9cd
Component: engine
2014-07-30 09:26:51 +00:00
190fbe906e Check for OS and root privileges in NewDaemon
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 419b9fe16425c301855aab781e1386f7a227a09d
Component: engine
2014-07-30 09:26:51 +00:00
e25f77248d Move parsing functions to pkg/parsers and the specific kernel handling
functions to pkg/parsers/kernel, and parsing filters to
pkg/parsers/filter. Adjust imports and package references.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 4398108433121ce2ac9942e607da20fa1680871a
Component: engine
2014-07-29 13:09:10 -07:00
6ae4c9014c update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b3ee9ac74e171e00f14027e39278013629e681b8
Component: engine
2014-07-24 22:19:50 +00:00
dd94d217ed Merge pull request #6976 from vbatts/vbatts-early_daemon_pidfile
docker daemon: initialize the daemon pidfile early
Upstream-commit: d0e2d9ec395f1d00b685bf80ab2431b1d8dce161
Component: engine
2014-07-21 14:26:14 -07:00
4e42254381 Closes 6937. Allows setting of docker config dir.
Can now dynamically set the docker config directory through an
environment variable.

export DOCKER_CONFIG=/path/to/docker_config/

Default behavior remains the same, e.g. ~/.docker

Documentation for change added to the https.md docs.

Docker-DCO-1.1-Signed-off-by: James A. Kyle <james@jameskyle.org> (github: jameskyle)
Upstream-commit: c0471ee35aa58a99b423ad914301194e8f3663c1
Component: engine
2014-07-15 15:47:00 -07:00
5bb5de48d2 docker daemon: initialize the daemon pidfile early
fixes https://github.com/dotcloud/docker/issues/6973

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Upstream-commit: 848e837698922fed0fa67930aa0b56a96b1b832d
Component: engine
2014-07-12 08:25:05 -04:00
f67899e5d8 update for consistency
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b68111713ddab28485122f149055c865ac4dadaa
Component: engine
2014-07-09 21:48:02 +00:00
f134d9e4d0 Add support for IPv6 addresses in --dns parameters.
Docker-DCO-1.1-Signed-off-by: Jan Pazdziora <jpazdziora@redhat.com> (github: adelton)
Upstream-commit: 899e9e74165b567c157756d56c47d33fac82c05a
Component: engine
2014-07-09 21:48:02 +00:00
75cb3255af Merge pull request #6720 from fabiofalci/relax_dns_search
Relax dns search to accept empty domain
Upstream-commit: 170609e36957fc044723789bc66918bd7d189702
Component: engine
2014-07-07 15:12:29 -07:00
525592aa62 Relax dns search to accept empty domain
In that case /etc/resolv.conf will be generated with no search
option. Usage: --dns-search=.

Docker-DCO-1.1-Signed-off-by: Fabio Falci <fabiofalci@gmail.com> (github: fabiofalci)
Upstream-commit: 804b00cd7d1f084a872211e5043d255c454c8e51
Component: engine
2014-07-04 09:33:53 +01:00
9b1af46554 Error if Docker daemon starts with BTRFS graph driver and SELinux enabled
The Docker btrfs graph driver does not interact well with SELinux at present.
If btrfs mounts the same file in several locations, the same SELinux label will
be applied to all mountpoints. In the context of the graph driver, things such
as shared libraries become inaccessible to containers due to SELInux, causing
all dynamically linked applications to fail when run in a container.

Consequently, error when we detect the daemon is being run with SELinux enabled
and the btrfs driver. Documentation has been added for this behavior.

Docker-DCO-1.1-Signed-off-by: Matthew Heon <mheon@redhat.com> (github: mheon)
Upstream-commit: 4318802f645cdd4fa63a894160f153a69a97af59
Component: engine
2014-07-03 08:11:18 -04:00
11bdd53bca Adds check if default ip address is correct format.
It avoids hidden error when ports are redirected from
container to host using -p host_port:guest_port.

Docker-DCO-1.1-Signed-off-by: Jiří Župka <jzupka@redhat.com> (github: jzupka)
Upstream-commit: 2fcbfb5a66249739ef04d414307be01371190bef
Component: engine
2014-06-27 15:55:20 +02:00
58acc86336 Add mutex warning when specifying -icc or -ip-forward and -iptables=false
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 05f293e65eeb7d1c86ba5644ed8d682aaeddd53d
Component: engine
2014-06-24 15:49:35 -07:00
90c80009e3 Add Sockets (-H) list to docker -D info.
This will allow us to _know_ what the user's -H settings are, which may
be useful for debugging later.

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
Upstream-commit: f54823bf05af1d549aee4f0d1f56f9a8995eb268
Component: engine
2014-06-24 12:25:17 +10:00
ca9f863c20 be consistent in capitalization of Docker
Docker-DCO-1.1-Signed-off-by: Jonathan Boulle <jonathanboulle@gmail.com> (github: jonboulle)
Upstream-commit: 6d14e9f1acc3d5927cbd4f4b3c7ea0c691dea7bc
Component: engine
2014-06-20 14:05:46 -07:00
c68805e2a6 Merge pull request #5878 from timthelion/docs-docker-readme
Add README.md file for the docker directory
Upstream-commit: 7c52ab7f83a7e37f283d4c237111adc18bdf22b4
Component: engine
2014-06-18 12:19:43 -07:00
83cd706353 Add --storage-opt graph driver option and pass through to driver
This lets you add storage specific options for the daemon.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 822ea97ffcf10645720bb93108a60f8b9ce9931d
Component: engine
2014-06-05 10:42:27 +02:00
96dd02ddf5 Add README.md file for the docker directory
See issue #5873

Docker-DCO-1.1-Signed-off-by: Timothy <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)
Upstream-commit: 6854e2997ee2b17a2078c4411c6e2f8d001983f5
Component: engine
2014-05-20 09:04:46 +00:00
0763a3738d Merge pull request #5761 from SvenDowideit/pr_out_tell_the_user_not_to_run_from_osx
tell the user not to run -d from OSX
Upstream-commit: 704e9f9ff0e5af18938085298a0f6f69262d693a
Component: engine
2014-05-16 16:52:08 -07:00
267e5e63e1 tell the user not to run from OSX
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
Upstream-commit: fe445a2447e701cc91ef77d7bcb0978a5d373940
Component: engine
2014-05-13 12:51:00 +10:00
aba2e9f1f5 move acceptconnections as builtin
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 937f8f2d813f58480e4bb2c0060353be31b04e10
Component: engine
2014-05-13 01:53:38 +00:00
cb8e10ccdc make listen buffer optional
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: f3736265fdddef9e9a9ab588906eeb7abe8a0cf6
Component: engine
2014-05-13 01:51:41 +00:00
fdccd2aaa1 improve some usages
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b622da3cfe211d31df69e72a93ed4fae872aca65
Component: engine
2014-05-06 21:32:12 +00:00
8b6dc7dcb1 Merge pull request #5575 from vieux/pr-5428
Upstream-commit: 51933bd5e1d10eb4a3151088cf344d0d6e06a192
Component: engine
2014-05-05 13:48:36 -07:00
b560ddbfed Merge pull request #5496 from unclejack/check_if_root
check if the daemon is run as root on startup
Upstream-commit: 5f301191cfd16d6898514112658e91eaaff238b3
Component: engine
2014-05-05 10:13:17 -07:00
7019e452c0 remove fixme
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 328d65dcff423b14e76f03ee65445032da31ed42
Component: engine
2014-05-03 00:54:52 +00:00
68135ccf7d check if the daemon is run as root on startup
This commit makes Docker throw an error if the daemon isn't started as
root.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 4fac4d2149856f0740a98e87ef0e0e6bd04d1b53
Component: engine
2014-04-30 14:13:39 +03:00
a5f91ab172 This patch reworks the SELinux patch to be only run on demand by the daemon
Added --selinux-enable switch to daemon to enable SELinux labeling.

The daemon will now generate a new unique random SELinux label when a
container starts, and remove it when the container is removed.   The MCS
labels will be stored in the daemon memory.  The labels of containers will
be stored in the container.json file.

When the daemon restarts on boot or if done by an admin, it will read all containers json files and reserve the MCS labels.

A potential problem would be conflicts if you setup thousands of containers,
current scheme would handle ~500,000 containers.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: crosbymichael)
Upstream-commit: b7942ec2ca7c7568df0c3b7eb554b05e2c3a3081
Component: engine
2014-04-29 03:40:05 -07:00
2acb87c29f Initial work on selinux patch
This has every container using the docker daemon's pid for the processes
label so it does not work correctly.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: f0e6e135a8d733af173bf0b8732c704c9ec716d7
Component: engine
2014-04-29 03:40:05 -07:00
84cddc3f87 add a reference to multiple -H options, and update the other example of -H option
and copy changes to the cli.md file

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
Upstream-commit: b2c87fe08b71523eb20fed63e5da3bef30b756ec
Component: engine
2014-04-24 11:24:58 +10:00
5742188cb8 - unix://path/to/socket should read unix:///path/to/socket like the rest of the documentation (a slash was missing)
- Mention that [] options may be specified multiple times on the Usage page

Docker-DCO-1.1-Signed-off-by: Mike MacCana <mike.maccana@gmail.com> (github: mikemaccana)

Docker-DCO-1.1-Signed-off-by: Mike MacCana <mike.maccana@gmail.com> (github: SvenDowideit)
Upstream-commit: e62efb266fd878453b8562e60b06a3e579fe571a
Component: engine
2014-04-24 11:11:51 +10:00
d8eb119f29 Remove error from engine.New()
Without creating a root there is no way for the engine to return an
error from the new function.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 7100ace42bda2660d1eaecb2ec096ba6753688ea
Component: engine
2014-04-23 11:54:35 -07:00