use of com.spotify.docker.client.auth.FixedRegistryAuthSupplier in project jackrabbit-oak by apache.
the class AzuriteDockerRule method apply.
@Override
public Statement apply(Statement statement, Description description) {
try {
DefaultDockerClient client = DefaultDockerClient.fromEnv().connectTimeoutMillis(5000L).readTimeoutMillis(20000L).registryAuthSupplier(new FixedRegistryAuthSupplier()).build();
client.ping();
client.pull(IMAGE);
client.close();
} catch (Throwable t) {
Assume.assumeNoException(t);
}
return wrappedRule.apply(statement, description);
}
use of com.spotify.docker.client.auth.FixedRegistryAuthSupplier in project docker-client by spotify.
the class PushPullIT method testBuildHubPrivateImageWithAuth.
@Test
public void testBuildHubPrivateImageWithAuth() throws Exception {
final String dockerDirectory = Resources.getResource("dockerDirectoryNeedsAuth").getPath();
final RegistryAuth registryAuth = RegistryAuth.builder().username(HUB_AUTH_USERNAME2).password(HUB_AUTH_PASSWORD2).build();
final DockerClient client = DefaultDockerClient.fromEnv().registryAuthSupplier(new FixedRegistryAuthSupplier(registryAuth, RegistryConfigs.create(singletonMap(HUB_NAME, registryAuth)))).build();
client.build(Paths.get(dockerDirectory), "testauth", BuildParam.pullNewerImage());
}
use of com.spotify.docker.client.auth.FixedRegistryAuthSupplier in project docker-client by spotify.
the class PushPullIT method testPushHubPublicImageWithAuth.
@Test
public void testPushHubPublicImageWithAuth() throws Exception {
// Push an image to a public repo on Docker Hub and check it succeeds
final String dockerDirectory = Resources.getResource("dockerDirectory").getPath();
final RegistryAuth registryAuth = RegistryAuth.builder().username(HUB_AUTH_USERNAME).password(HUB_AUTH_PASSWORD).build();
final DockerClient client = DefaultDockerClient.fromEnv().registryAuthSupplier(new FixedRegistryAuthSupplier(registryAuth, RegistryConfigs.create(singletonMap(HUB_NAME, registryAuth)))).build();
client.build(Paths.get(dockerDirectory), HUB_PUBLIC_IMAGE);
client.push(HUB_PUBLIC_IMAGE);
}
use of com.spotify.docker.client.auth.FixedRegistryAuthSupplier in project jackrabbit-oak by apache.
the class AzuriteDockerRule method apply.
@Override
public Statement apply(Statement statement, Description description) {
try {
DefaultDockerClient client = DefaultDockerClient.fromEnv().connectTimeoutMillis(5000L).readTimeoutMillis(20000L).registryAuthSupplier(new FixedRegistryAuthSupplier()).build();
client.ping();
client.pull(IMAGE);
client.close();
} catch (Throwable t) {
Assume.assumeNoException(t);
}
return wrappedRule.apply(statement, description);
}
Aggregations