Commit Graph

216 Commits

Author SHA1 Message Date
dc62b54723 Merge pull request #7110 from tiborvass/merge-6907
Docker create (rebase of 6907)
Upstream-commit: ca39a3e36b8b76539bc30f0f4e2761222c50919f
Component: engine
2014-09-17 03:23:50 +04:00
764b128304 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)
Upstream-commit: 3a90004f3c2d86ec849f4674c8046693ea061ed1
Component: engine
2014-09-16 18:40:24 -04:00
9681f2740a add exec to the commands list
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: fccb02622183ee93036d4f5068817830f3297ab5
Component: engine
2014-09-17 01:13:43 +03:00
fd1a27eae9 Consolidate documentation for -H option
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Upstream-commit: fec81690ccaf4c4b81342f632bc1a3ec3ad6b86c
Component: engine
2014-09-09 10:12:03 -07:00
289cb70195 Add instructions on how to get help on commands
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Upstream-commit: d128d9e669d840160f9f2357324f710d59a7a7d7
Component: engine
2014-09-08 16:09:16 -07:00
2326e18ef0 Print consistent help with options and commands
These commands now all output the same thing:

 - docker
 - docker help
 - docker --help
 - docker -h

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Upstream-commit: f3ed7b601fa6151868416254e79a18751c5ff024
Component: engine
2014-09-08 16:08:50 -07:00
b36a54587e builder: fix references to jobs in daemon, make builder a first class
package referring to evaluator

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 1ae4c00a19edb7d3b41c050489e56339833d8e01
Component: engine
2014-08-27 18:52:30 -07:00
676eea0fcd Revert "--help option and help command should print to stdout not stderr"
This reverts commit 61b129d81802e3c988cc0e67e488b24968dd748a.

Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 2e489073d94a7e2a5df115704a484c34f0b59f29
Component: engine
2014-08-27 18:59:13 +00:00
91ac365d86 Merge pull request #6052 from rhatdan/help
--help option and help command should print to stdout not stderr
Upstream-commit: 76fd51a4789c1af15d6682a01add3ff86df2f5cf
Component: engine
2014-08-27 11:17:16 -07:00
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
f13f1856df --help option and help command should print to stdout not stderr
--help and help are successful commands so output should not go to error.

QE teams have requested this change, also users doing docker help | less
or docker run --help | less would expect this to work.

Usage statement should only be printed when the user asks for it.
Errors should print error message and then suggest the docker COMMAND --help
command to see usage information.

The current behaviour causes the user to have to search for the error message
and sometimes scrolls right off the screen.  For example a error on a
"docker run" command is very difficult to diagnose.

Finally erros should always exit with a non 0 exit code, if the user
makes a CLI error.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 61b129d81802e3c988cc0e67e488b24968dd748a
Component: engine
2014-08-21 15:35:20 -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