use of com.artipie.docker.composite.ReadWriteDocker in project artipie by artipie.
the class DockerProxy method delegate.
/**
* Creates Docker proxy repository slice from configuration.
*
* @return Docker proxy slice.
*/
private Slice delegate() {
final Docker proxies = new MultiReadDocker(this.cfg.proxy().remotes().stream().map(remote -> proxy(this.client, remote)).collect(Collectors.toList()));
Docker docker = this.cfg.storageOpt().<Docker>map(storage -> {
final AstoDocker local = new AstoDocker(new SubStorage(RegistryRoot.V2, storage));
return new ReadWriteDocker(new MultiReadDocker(local, proxies), local);
}).orElse(proxies);
if (!this.standalone) {
docker = new TrimmedDocker(docker, this.cfg.name());
}
Slice slice = new DockerSlice(docker, new DockerPermissions(this.perms), new BasicAuthScheme(this.auth));
if (!this.standalone) {
slice = new DockerRoutingSlice.Reverted(slice);
}
return slice;
}
Aggregations