2014-10-25 01:37:25 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/docker/docker-registry/storagedriver/ipc"
|
|
|
|
"github.com/docker/docker-registry/storagedriver/s3"
|
|
|
|
)
|
|
|
|
|
2014-10-29 02:15:40 +01:00
|
|
|
// An out-of-process S3 driver, intended to be run by ipc.NewDriverClient
|
2014-10-25 01:37:25 +02:00
|
|
|
func main() {
|
|
|
|
parametersBytes := []byte(os.Args[1])
|
2014-10-29 02:15:40 +01:00
|
|
|
var parameters map[string]string
|
2014-10-25 01:37:25 +02:00
|
|
|
err := json.Unmarshal(parametersBytes, ¶meters)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
2014-10-29 02:15:40 +01:00
|
|
|
driver, err := s3.FromParameters(parameters)
|
2014-10-25 01:37:25 +02:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
2014-10-29 02:15:40 +01:00
|
|
|
ipc.StorageDriverServer(driver)
|
2014-10-25 01:37:25 +02:00
|
|
|
}
|