return ContainerRegistryAuthSupplier.forCredentials(credentials).build();
/** * Constructs a ContainerRegistryAuthSupplier using the specified credentials. * * @see Builder */ public static Builder forCredentials(final GoogleCredentials credentials) { return new Builder(credentials); }
/** * Constructs a ContainerRegistryAuthSupplier using the Application Default Credentials. * * @see Builder */ public static Builder forApplicationDefaultCredentials() throws IOException { return new Builder(GoogleCredentials.getApplicationDefault()); }
/** * Constructs a ContainerRegistryAuthSupplier for the account with the given credentials. * * @see Builder */ public static Builder fromStream(final InputStream credentialsStream) throws IOException { final GoogleCredentials credentials = GoogleCredentials.fromStream(credentialsStream); return new Builder(credentials); }
private DockerClient createDockerClient(final AgentConfig config) throws IOException { final DefaultDockerClient.Builder builder = DefaultDockerClient.builder() .uri(config.getDockerHost().uri()); if (config.getConnectionPoolSize() != -1) { builder.connectionPoolSize(config.getConnectionPoolSize()); } if (!isNullOrEmpty(config.getDockerHost().dockerCertPath())) { final Path dockerCertPath = java.nio.file.Paths.get(config.getDockerHost().dockerCertPath()); final DockerCertificates dockerCertificates; try { dockerCertificates = new DockerCertificates(dockerCertPath); } catch (DockerCertificateException e) { throw new RuntimeException(e); } builder.dockerCertificates(dockerCertificates); } if (config.getGoogleCredentials() != null) { builder.registryAuthSupplier( ContainerRegistryAuthSupplier .forCredentials(config.getGoogleCredentials()) .build() ); } return new PollingDockerClient(builder); }
/** * Constructs a ContainerRegistryAuthSupplier using the specified credentials. * * @see Builder */ public static Builder forCredentials(final GoogleCredentials credentials) { return new Builder(credentials); }
/** * Constructs a ContainerRegistryAuthSupplier for the account with the given credentials. * * @see Builder */ public static Builder fromStream(final InputStream credentialsStream) throws IOException { final GoogleCredentials credentials = GoogleCredentials.fromStream(credentialsStream); return new Builder(credentials); }
/** * Constructs a ContainerRegistryAuthSupplier using the Application Default Credentials. * * @see Builder */ public static Builder forApplicationDefaultCredentials() throws IOException { return new Builder(GoogleCredentials.getApplicationDefault()); }