Changed sync behaviour, it used to copy images over http interface

now it copies to a local cache and then it copies over storage APIs

- accept all images with or without signatures
- disable sync writing to stdout
- added more logs
- fixed switch statement in routes
- fixed enabling sync multiple times for storage subpaths

closes #266

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
Petu Eusebiu
2021-10-28 12:10:01 +03:00
committed by Ramkumar Chinchani
parent 9c568c0ee2
commit 5c07e19c8d
15 changed files with 1269 additions and 289 deletions
+60
View File
@@ -24,6 +24,7 @@ Examples of working configurations for various use cases are available [here](..
* [Identity-based Authorization](#identity-based-authorization)
* [Logging](#logging)
* [Metrics](#metrics)
* [Sync](#sync)
## Network
@@ -336,3 +337,62 @@ For more details see https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/c
## Sync
Enable and configure sync with:
```
"sync": {
```
Configure credentials for upstream registries:
```
"credentialsFile": "./examples/sync-auth-filepath.json",
```
Configure each registry sync:
```
"registries": [{
"url": "https://registry1:5000",
"onDemand": false, # pull any image which the local registry doesn't have
"pollInterval": "6h", # polling interval
"tlsVerify": true, # wheather or not to verify tls
"certDir": "/home/user/certs", # use certificates at certDir path, if not specified then use the default certs dir
"content":[ # which content to periodically pull
{
"prefix":"/repo1/repo", # pull all images under /repo1/repo
"tags":{ # filter by tags
"regex":"4.*", # filter tags by regex
"semver":true # filter tags by semver compliance
}
},
{
"prefix":"/repo2/repo" # pull all images under /repo2/repo
}
]
},
{
"url": "https://registry2:5000",
"pollInterval": "12h",
"tlsVerify": false,
"onDemand": false,
"content":[
{
"prefix":"/repo2",
"tags":{
"semver":true
}
}
]
},
{
"url": "https://docker.io/library",
"onDemand": true, # doesn't have content, don't periodically pull, pull just on demand.
"tlsVerify": true
}
]
}
```
+1 -1
View File
@@ -5,7 +5,7 @@
},
"http":{
"address":"127.0.0.1",
"port":"5000"
"port":"8080"
},
"log":{
"level":"debug"
+1 -1
View File
@@ -1,5 +1,5 @@
{
"localhost:8080": {
"127.0.0.1:8080": {
"username": "user",
"password": "pass"
},