question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pullImageCmd with registry config in DefaultDockerClientConfig

See original GitHub issue

Hi!

I am trying to pull an image from a private repository.

If I run the pullImageCmd providing an AuthConfig It works successfully :

AuthConfig authConfig = new AuthConfig().withUsername(username).withPassword(password)
.withRegistryAddress("https://xxxx.dkr.ecr.us-west-2.amazonaws.com");

dockerClient.pullImageCmd("xxxx.dkr.ecr.us-west-2.amazonaws.com/xxxx/xxxx")
.withTag("1.1").**withAuthConfig(authConfig)**
.exec(new PullImageResultCallback()).awaitCompletion();

But if I set the registry configuration when creating the DockerClient it doesn´t work

DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder().withRegistryPassword(password)
.withRegistryUsername(username)
.withRegistryUrl("https://xxxx.dkr.ecr.us-west-2.amazonaws.com")
.withDockerHost(environmentConfig.getDockerAgentAddress()).build();
dockerClient.pullImageCmd("xxxx.dkr.ecr.us-west-2.amazonaws.com/xxxx/xxxx")
.withTag("1.1").
.exec(new PullImageResultCallback()).awaitCompletion();

Why pullImageCmd is not using the DockerClientConfig when AuthConfig is not provided?

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
KostyaShacommented, Jun 28, 2017

Why pullImageCmd is not using the DockerClientConfig when AuthConfig is not provided?

Feel free to debug code.

0reactions
stale[bot]commented, Jun 19, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

com.github.dockerjava.api.command.PullImageCmd ...
Produces a pull image request * * @param client * @param message * @return */ private PullImageCmd executePullImageRequest(DockerClient client, ...
Read more >
A Docker Guide for Java - Baeldung
DefaultDockerClientConfig config = DefaultDockerClientConfig. ... images from registry services, we make use of the pullImageCmd method.
Read more >
0 - Stack Overflow
I am trying to use the docker-java library but I am running into a problem when I try to pull an image. I...
Read more >
com.github.dockerjava.api.model.AuthConfig Java Examples
Source Project: cubeai Author: cube-ai File: PullImageCommand.java License: Apache ... registryPassword = registryPassword; DefaultDockerClientConfig.
Read more >
Getting started with Docker-Java -
DefaultDockerClientConfig clientConfig ... To download images from registry services, we make use of the pullImageCmd() method.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found