Commit graph

83 commits

Author SHA1 Message Date
Solomon Hykes
491deae9b8 Move "build" to daemon/build.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 03:12:33 +00:00
Solomon Hykes
20b0841c1b Remove last trace of Daemon->Server dependency
This removes a shim `daemon.Server` interface which was used to start
separating Daemon from Server *gradually*, without getting cyclic
dependency errors.

Now that the last Daemon->Server dependency has been removed, we can
finally remove the shim. Yay!

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:56:12 +00:00
Solomon Hykes
c9f3fd3fc7 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>
2014-08-06 17:56:11 +00:00
Solomon Hykes
94715e8e64 Move "info" to daemon/info.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-08 03:01:55 +00:00
Michael Crosby
bc9f5cdeb5 Merge pull request #7329 from erikh/move_broadcastwriter
Cleanup: utils/broadcastwriter -> pkg/broadcastwriter
2014-08-07 14:51:42 -07:00
Michael Crosby
140e6abb17 Merge pull request #7443 from ewindisch/name-id-lookup-reversal
Container name lookups to prefer IDs over names
2014-08-07 11:14:47 -07:00
Erik Hollensbe
5ab09f2f71 utils/broadcastwriter -> pkg/broadcastwriter
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-06 16:37:01 -07:00
Eric Windisch
231e07ded4 Container name lookups to prefer IDs over names
Lookups of container names should prefer the ID over
names assigned to containers by users.

Signed-off-by: Eric Windisch <eric@windisch.us>
2014-08-06 13:09:11 -04:00
Solomon Hykes
7a5e3df162 Move "image_delete" to daemon/image_delete.go
Note: this cannot yet be moved to graph/ because of a lingering
dependency on daemon. This has been noted in a FIXME.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00
Dan Walsh
b4813f2841 Docker should use /var/lib/container/tmp for large temporary files.
/tmp is often a tmpfs file system and large temporary files could cause
docker commands to fail.  Also using /tmp potentially allows users on the
system to get access to content, or even attack the content.  Moving the tmpdir to
/var/lib/container/tmp will protect the data.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)

Conflicts:
	docker/docker.go
2014-08-05 16:43:42 -04:00
Solomon Hykes
f46de04af6 Cleanup daemon/Daemon.Install for readability
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:25:02 -04:00
Solomon Hykes
d037007658 Move "containers" to daemon/list.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:24:58 -04:00
Solomon Hykes
aa49632fef Move "top" to daemon/top.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:24:52 -04:00
Solomon Hykes
49e61f62ce Move "changes" to daemon/changes.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)

Fix issues with renaming changes to container_changes
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-08-01 14:24:46 -04:00
Solomon Hykes
06229a4b76 Move "copy" to daemon/copy.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:24:41 -04:00
Solomon Hykes
cc39d579f5 Move "delete" to daemon/delete.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)

Fix issues with renaming container_delete to delete
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-08-01 14:24:28 -04:00
Solomon Hykes
066330fc96 Move "logs" to daemon/logs.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:17:29 -04:00
Solomon Hykes
fdad41f5b9 Move "commit" to daemon/commit.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:17:24 -04:00
Solomon Hykes
e0fd96f850 Move "resize" to daemon/resize.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:17:20 -04:00
Solomon Hykes
c4ce396f46 Move "wait" to daemon/wait.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:17:16 -04:00
Solomon Hykes
bd54a73c42 Move "restart" to daemon/restart.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:17:11 -04:00
Solomon Hykes
4180b87514 Move "start" to daemon/start.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:17:04 -04:00
Solomon Hykes
03c07617cc Move "stop" to daemon/stop.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:59 -04: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
Solomon Hykes
8031c23b0f Move "export" to daemon/export.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:41 -04:00
Solomon Hykes
8652830661 Move "kill" to daemon/kill.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:05 -04:00
Solomon Hykes
63bd4ad9d6 Move "unpause" to daemon/pause.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-07-30 14:01:43 +00:00
Solomon Hykes
42a77de3d3 Move "pause" to daemon/pause.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-07-30 14:01:40 +00:00
Solomon Hykes
c2496d97cc Move Server.ContainerAttach to Daemon.ContainerAttach
This is part of an effort to break apart the legacy server package. Help wanted!

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-07-30 11:20:31 +00:00
Solomon Hykes
4949e070fb Move kernel version/capabilities detection to NewDaemon
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-07-30 09:26:51 +00:00
Solomon Hykes
e92a9e0b53 Move canonical root path detection to NewDaemon
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-07-30 09:26:51 +00:00
Solomon Hykes
a7d8c732b1 Move TMPDIR symlink cleanup to NewDaemon
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-07-30 09:26:51 +00:00
Solomon Hykes
419b9fe164 Check for OS and root privileges in NewDaemon
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-07-30 09:26:51 +00:00
Erik Hollensbe
4398108433 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)
2014-07-29 13:09:10 -07:00
Erik Hollensbe
3a177ccd3a server/buildfile.go -> builder/builder.go; add maintainers file
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-07-29 11:35:02 -07:00
Victor Vieux
5a0ef08c94 gofmt -s -w
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-24 22:25:29 +00:00
Victor Vieux
b3ee9ac74e update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-24 22:19:50 +00:00
Michael Crosby
a091d949ac Always mark as stopped for non running containers
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-07-21 19:59:44 -07:00
Michael Crosby
7a8ea91392 Fix cross compile non cgo and linux systems
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-07-16 16:57:49 -07:00
Michael Crosby
bade039bda Merge pull request #6821 from LK4D4/broadcast_writer_refactor
Broadcast writer refactor
2014-07-07 12:15:47 -07:00
Matthew Heon
4318802f64 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)
2014-07-03 08:11:18 -04:00
SvenDowideit
fa29b1f062 I'm going to wish I didn't do this
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-07-03 10:31:56 +10:00
LK4D4
9d4e802221 Move WriteBroadcaster to separate package as BroadcastWriter
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-07-02 23:31:06 +04:00
Eric Windisch
17d870bed5 Pause/freeze containers during commit
Initiates a pause before committing a container,
adds a pause option to the commit command, defaulting to 'true'.

Fixes bug: #6267
Fixes bug: #3675

Docker-DCO-1.1-Signed-off-by: Eric Windisch <ewindisch@docker.com> (github: ewindisch)
2014-07-01 00:30:21 +00:00
Alexandr Morozov
57d86a5619 Use State waiting functions
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-27 15:07:40 +04:00
unclejack
e0dad30579 refactor TruncIndex to use a trie & vendor deps
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-06-26 16:57:54 +03:00
unclejack
c4dbd4f7c0 Merge pull request #6648 from LK4D4/truncindex_bench
Truncindex benchmarks
2014-06-24 22:10:33 +03:00
LK4D4
ed032ddfd6 Move truncindex in separate package in pkg/
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-24 21:19:15 +04:00
Sven Dowideit
f54823bf05 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)
2014-06-24 12:25:17 +10:00
Michael Crosby
51b188c510 Merge pull request #6214 from LK4D4/fix_some_more_race_conditions
Fix some more race conditions
2014-06-12 15:17:10 -07:00