Adds storage driver interface, tests, and two basic implementations
This commit is contained in:
parent
12e68998e1
commit
3f95694180
12 changed files with 1320 additions and 0 deletions
26
main/storagedriver/filesystem/filesystem.go
Normal file
26
main/storagedriver/filesystem/filesystem.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
|
||||
"github.com/docker/docker-registry/storagedriver/filesystem"
|
||||
"github.com/docker/docker-registry/storagedriver/ipc"
|
||||
)
|
||||
|
||||
func main() {
|
||||
parametersBytes := []byte(os.Args[1])
|
||||
var parameters map[string]interface{}
|
||||
err := json.Unmarshal(parametersBytes, ¶meters)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
rootDirectory := "/tmp/registry"
|
||||
if parameters != nil {
|
||||
rootDirParam, ok := parameters["RootDirectory"].(string)
|
||||
if ok && rootDirParam != "" {
|
||||
rootDirectory = rootDirParam
|
||||
}
|
||||
}
|
||||
ipc.Server(filesystem.NewDriver(rootDirectory))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue