From 6e0cfc17dc4942a4d89af70fc93b58e72debc1da Mon Sep 17 00:00:00 2001 From: Olivier Gambier Date: Wed, 10 Jun 2015 20:54:24 -0700 Subject: [PATCH] Saner default data location Signed-off-by: Olivier Gambier --- cmd/registry/config.yml | 2 +- docs/configuration.md | 14 +++++++------- docs/deploying.md | 2 -- docs/storage-drivers/filesystem.md | 2 +- registry/storage/driver/filesystem/driver.go | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/cmd/registry/config.yml b/cmd/registry/config.yml index 6d41cc8f..ba591467 100644 --- a/cmd/registry/config.yml +++ b/cmd/registry/config.yml @@ -22,7 +22,7 @@ storage: cache: blobdescriptor: redis filesystem: - rootdirectory: /tmp/registry-dev + rootdirectory: /var/lib/registry maintenance: uploadpurging: enabled: false diff --git a/docs/configuration.md b/docs/configuration.md index 68fb54c5..6c423d60 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -21,16 +21,16 @@ configure the `rootdirectory` of the `filesystem` storage backend: ``` storage: filesystem: - rootdirectory: /tmp/registry-dev + rootdirectory: /var/lib/registry ``` To override this value, set an environment variable like this: ``` -REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/tmp/registry/test +REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/somewhere ``` -This variable overrides the `/tmp/registry-dev` value to the `/tmp/registry/test` +This variable overrides the `/var/lib/registry` value to the `/somewhere` directory. >**Note**: If an environment variable changes a map value into a string, such @@ -72,7 +72,7 @@ log: loglevel: debug # deprecated: use "log" storage: filesystem: - rootdirectory: /tmp/registry-dev + rootdirectory: /var/lib/registry azure: accountname: accountname accountkey: base64encodedaccountkey @@ -284,7 +284,7 @@ Permitted values are `error`, `warn`, `info` and `debug`. The default is ```yaml storage: filesystem: - rootdirectory: /tmp/registry + rootdirectory: /var/lib/registry azure: accountname: accountname accountkey: base64encodedaccountkey @@ -1342,7 +1342,7 @@ log: level: debug storage: filesystem: - rootdirectory: /tmp/registry-dev + rootdirectory: /var/lib/registry http: addr: localhost:5000 secret: asecretforlocaldevelopment @@ -1352,7 +1352,7 @@ http: The above configures the registry instance to run on port `5000`, binding to `localhost`, with the `debug` server enabled. Registry data storage is in the -`/tmp/registry-dev` directory. Logging is in `debug` mode, which is the most +`/var/lib/registry` directory. Logging is in `debug` mode, which is the most verbose. A similar simple configuration is available at diff --git a/docs/deploying.md b/docs/deploying.md index c0f31aac..1a9e67aa 100644 --- a/docs/deploying.md +++ b/docs/deploying.md @@ -17,7 +17,6 @@ Create a folder for your registry data: Start your registry: $ docker run -d -p 5000:5000 \ - -v `pwd`/registry-data:/tmp/registry-dev \ --restart=always --name registry registry:2 That's it. @@ -62,7 +61,6 @@ docker stop registry && docker rm registry # Start your registry with TLS enabled docker run -d -p 5000:5000 \ - -v `pwd`/registry-data:/tmp/registry-dev \ -v `pwd`/certs:/certs \ -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ diff --git a/docs/storage-drivers/filesystem.md b/docs/storage-drivers/filesystem.md index fa9f8259..23d4afba 100644 --- a/docs/storage-drivers/filesystem.md +++ b/docs/storage-drivers/filesystem.md @@ -10,4 +10,4 @@ An implementation of the `storagedriver.StorageDriver` interface which uses the ## Parameters -`rootdirectory`: (optional) The root directory tree in which all registry files will be stored. Defaults to `/tmp/registry/storage`. +`rootdirectory`: (optional) The root directory tree in which all registry files will be stored. Defaults to `/var/lib/registry`. diff --git a/registry/storage/driver/filesystem/driver.go b/registry/storage/driver/filesystem/driver.go index 82960314..d5d8708c 100644 --- a/registry/storage/driver/filesystem/driver.go +++ b/registry/storage/driver/filesystem/driver.go @@ -16,7 +16,7 @@ import ( ) const driverName = "filesystem" -const defaultRootDirectory = "/tmp/registry/storage" +const defaultRootDirectory = "/var/lib/registry" func init() { factory.Register(driverName, &filesystemDriverFactory{})