1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/daemon
Sebastiaan van Stijn 1262c57714
Skip empty directories on prior graphdriver detection
When starting the daemon, the `/var/lib/docker` directory
is scanned for existing directories, so that the previously
selected graphdriver will automatically be used.

In some situations, empty directories are present (those
directories can be created during feature detection of
graph-drivers), in which case the daemon refuses to start.

This patch improves detection, and skips empty directories,
so that leftover directories don't cause the daemon to
fail.

Before this change:

    $ mkdir /var/lib/docker /var/lib/docker/aufs /var/lib/docker/overlay2
    $ dockerd
    ...
    Error starting daemon: error initializing graphdriver: /var/lib/docker contains several valid graphdrivers: overlay2, aufs; Please cleanup or explicitly choose storage driver (-s <DRIVER>)

With this patch applied:

    $ mkdir /var/lib/docker /var/lib/docker/aufs /var/lib/docker/overlay2
    $ dockerd
    ...
    INFO[2017-11-16T17:26:43.207739140Z] Docker daemon                                 commit=ab90bc296 graphdriver(s)=overlay2 version=dev
    INFO[2017-11-16T17:26:43.208033095Z] Daemon has completed initialization

And on restart (prior graphdriver is still picked up):

    $ dockerd
    ...
    INFO[2017-11-16T17:27:52.260361465Z] [graphdriver] using prior storage driver: overlay2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-11-21 15:42:04 +01:00
..
caps Copy Inslice() to those parts that use it 2017-11-10 13:42:38 +08:00
cluster Cancelation errors should not be logged 2017-11-14 20:32:20 -05:00
config Remove deprecated support for duplicate label-keys 2017-11-12 03:11:37 +01:00
discovery Add ineffassign linter 2017-09-08 18:23:21 -04:00
events Merge pull request #34985 from thaJeztah/remove-use-of-deprecated-filter-functions 2017-09-27 17:34:07 +02:00
exec Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
graphdriver Skip empty directories on prior graphdriver detection 2017-11-21 15:42:04 +01:00
initlayer Remove solaris files 2017-10-24 15:39:34 -04:00
links use t.Fatal() to output the err message where the values used for formatting 2017-02-23 10:16:22 +08:00
listeners Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
logger Merge pull request #35073 from mle-ii/master 2017-11-08 14:53:56 -08:00
names Move names to a more appropriate package. 2017-09-06 12:05:16 -04:00
network Typo fixed and simple code. 2017-10-18 10:26:58 +08:00
stats Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
testdata Remove libtrust dep from api 2017-09-06 12:05:19 -04:00
apparmor_default.go apparmor: make pkg/aaparser work on read-only root 2017-05-18 00:05:13 +10:00
apparmor_default_unsupported.go daemon: switch to 'ensure' workflow for AppArmor profiles 2016-12-07 08:47:28 +11:00
archive.go LCOW: Implemented support for docker cp + build 2017-09-14 12:07:52 -07:00
archive_tarcopyoptions.go Partial refactor of UID/GID usage to use a unified struct. 2017-06-07 11:44:33 -04:00
archive_tarcopyoptions_unix.go Fix vfs unit test and port VFS to the new IDMappings 2017-06-07 11:44:34 -04:00
archive_tarcopyoptions_windows.go daemon/archive.go: Fix copy routines to preserve UID. 2017-04-12 10:33:19 +00:00
archive_unix.go LCOW: API change JSON header to string POST parameter 2017-10-06 15:26:48 -07:00
archive_windows.go Remove CopyOnBuild from the daemon. 2017-06-08 15:06:54 -04:00
attach.go Optimize some wrong usage and spelling 2017-09-07 09:44:08 +08:00
auth.go
bindmount_unix.go
build.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
cache.go Update logrus to v1.0.1 2017-07-31 13:16:46 -07:00
changes.go
checkpoint.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
cluster.go Fix race condition between swarm and libnetwork 2017-05-10 21:16:52 -07:00
commit.go Remove solaris files 2017-10-24 15:39:34 -04:00
configs.go Update logrus to v1.0.1 2017-07-31 13:16:46 -07:00
configs_linux.go Add config support to executor backend 2017-05-11 10:08:21 -07:00
configs_unsupported.go Add Windows configs support 2017-05-16 14:25:32 -07:00
configs_windows.go Add Windows configs support 2017-05-16 14:25:32 -07:00
container.go Added validation of isolation settings on daemon.verifyContainerSettings 2017-11-20 10:34:20 +01:00
container_linux.go Remove string checking in API error handling 2017-08-15 16:01:11 -04:00
container_operations.go Remove string checking in API error handling 2017-08-15 16:01:11 -04:00
container_operations_unix.go fix panic on get container pid when live restore containers 2017-10-10 22:45:34 +08:00
container_operations_windows.go Update logrus to v1.0.1 2017-07-31 13:16:46 -07:00
container_windows.go Added an apparmorEnabled boolean in the Daemon struct to indicate if AppArmor is enabled or not. It is set in NewDaemon using sysInfo information. 2017-01-30 16:23:23 +01:00
create.go Set OS on scratch image and prevent panic if empty 2017-11-06 18:22:15 -08:00
create_unix.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
create_windows.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
daemon.go Increase container default shutdown timeout on Windows 2017-10-23 10:31:31 -07:00
daemon_experimental.go
daemon_linux.go Update logrus to v1.0.1 2017-07-31 13:16:46 -07:00
daemon_linux_test.go Added validation of isolation settings on daemon.verifyContainerSettings 2017-11-20 10:34:20 +01:00
daemon_test.go Added validation of isolation settings on daemon.verifyContainerSettings 2017-11-20 10:34:20 +01:00
daemon_unix.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
daemon_unix_test.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
daemon_unsupported.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
daemon_windows.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
daemon_windows_test.go Ensure Host Network Service exists 2017-09-25 11:07:44 -07:00
debugtrap_unix.go Update logrus to v1.0.1 2017-07-31 13:16:46 -07:00
debugtrap_unsupported.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
debugtrap_windows.go Fix startup logging 2017-10-19 11:09:29 -07:00
delete.go Merge pull request #34999 from kolyshkin/wait-on-rm 2017-10-29 11:04:41 -07:00
delete_test.go Move ErrorContains to an internal package. 2017-08-25 12:04:58 -04:00
dependency.go Add config support to executor backend 2017-05-11 10:08:21 -07:00
disk_usage.go Fix variable shadowing causing LayersSize to be reported as 0 2017-09-12 14:11:11 -03:00
errors.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
events.go Update logrus to v1.0.1 2017-07-31 13:16:46 -07:00
events_test.go LCOW: Remove CommonContainer - just Container 2017-06-20 08:55:46 -07:00
exec.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
exec_linux.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
exec_solaris.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
exec_windows.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
export.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
getsize_unix.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
health.go container: protect the health status with mutex 2017-11-16 15:04:01 -08:00
health_test.go container: protect the health status with mutex 2017-11-16 15:04:01 -08:00
image.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
image_delete.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
image_exporter.go Move to a single tag-store 2017-08-18 17:09:27 -07:00
image_history.go Move to a single tag-store 2017-08-18 17:09:27 -07:00
image_inspect.go Move to a single tag-store 2017-08-18 17:09:27 -07:00
image_pull.go Move to a single tag-store 2017-08-18 17:09:27 -07:00
image_push.go Move to a single tag-store 2017-08-18 17:09:27 -07:00
image_tag.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
images.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
import.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
info.go Add unconvert linter 2017-08-24 15:08:31 -04:00
info_unix.go Use containerd API to get version 2017-11-03 01:46:58 +01:00
info_unix_test.go Refactor "init" version parsing, and add unit-test 2017-04-08 11:28:37 +02:00
info_windows.go
inspect.go container: protect the health status with mutex 2017-11-16 15:04:01 -08:00
inspect_solaris.go Move platform specific mount data to Container 2017-06-23 07:22:47 -07:00
inspect_unix.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
inspect_windows.go Move platform specific mount data to Container 2017-06-23 07:22:47 -07:00
keys.go
keys_unsupported.go change minor mistake of spelling 2016-12-20 21:05:19 +08:00
kill.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
links.go Remove links when remove container 2017-07-18 12:09:26 +08:00
list.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
list_unix.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
list_windows.go stop grabbing container locks during ps 2017-06-23 07:52:31 -07:00
logdrivers_linux.go
logdrivers_windows.go Add gelf log driver plugin to Windows build 2017-10-03 12:42:54 -07:00
logs.go Move json log reading into log file object 2017-11-04 08:31:58 -04:00
logs_test.go
metrics.go Add gosimple linter 2017-09-12 12:09:59 -04:00
metrics_unix.go Update logrus to v1.0.1 2017-07-31 13:16:46 -07:00
metrics_unsupported.go Add support for metrics plugins 2017-05-12 00:30:09 -04:00
monitor.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
monitor_linux.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
monitor_solaris.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
monitor_windows.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
mounts.go Fix issue backporting mount spec to pre-1.13 obj 2017-05-11 12:31:53 -04:00
names.go Fix conflicting container name producint 400 error instead of 409 2017-10-04 20:39:45 +02:00
network.go Remove solaris files 2017-10-24 15:39:34 -04:00
oci_linux.go Merge pull request #35316 from kolyshkin/facepalm 2017-11-14 11:13:59 +01:00
oci_windows.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
pause.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
prune.go Merge pull request #34960 from sterchelen/34953-Prune-Volume-lack-event-entry 2017-10-12 09:24:26 -07:00
reload.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
reload_test.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
rename.go Remove string checking in API error handling 2017-08-15 16:01:11 -04:00
resize.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
restart.go Update logrus to v1.0.1 2017-07-31 13:16:46 -07:00
search.go Replace uses of filters.ToParam(), FromParam() with filters.ToJSON(), FromJSON() 2017-09-26 13:59:45 +02:00
search_test.go Remove redundant format 2016-12-27 21:46:52 +08:00
seccomp_disabled.go
seccomp_linux.go Update logrus to v1.0.1 2017-07-31 13:16:46 -07:00
seccomp_unsupported.go
secrets.go Update logrus to v1.0.1 2017-07-31 13:16:46 -07:00
secrets_linux.go
secrets_unsupported.go Add Windows secrets support 2017-05-16 11:30:06 -07:00
secrets_windows.go Add Windows secrets support 2017-05-16 11:30:06 -07:00
selinux_linux.go Switch to using opencontainers/selinux for selinux bindings 2017-04-24 21:29:47 +02:00
selinux_unsupported.go
start.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
start_unix.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
start_windows.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
stats.go Remove solaris files 2017-10-24 15:39:34 -04:00
stats_collector.go Extract daemon statsCollector to its own package 2017-01-04 18:18:30 +01:00
stats_unix.go Remove string checking in API error handling 2017-08-15 16:01:11 -04:00
stats_windows.go
stop.go Optimize some wrong usage and spelling 2017-09-07 09:44:08 +08:00
top_unix.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
top_unix_test.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
top_windows.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
trustkey.go Remove libtrust dep from api 2017-09-06 12:05:19 -04:00
trustkey_test.go Remove libtrust dep from api 2017-09-06 12:05:19 -04:00
unpause.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
update.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
update_linux.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
update_solaris.go
update_windows.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
volumes.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
volumes_unit_test.go Volume refactoring for LCOW 2017-09-14 12:33:31 -07:00
volumes_unix.go Merge pull request #34224 from estesp/no-chown-nwfiles-outside-metadata 2017-11-02 15:00:42 -07:00
volumes_unix_test.go Spelling fixes 2017-07-03 13:13:09 -07:00
volumes_windows.go Partial refactor of UID/GID usage to use a unified struct. 2017-06-07 11:44:33 -04:00
wait.go Update ContainerWait API 2017-05-16 15:11:39 -07:00
workdir.go Remove error return from RootPair 2017-06-07 11:45:33 -04:00