Skip to content

Commit f2cd973

Browse files
committed
Merge pull request #165 from magnayn/pr6
PushImageCmd assumes that you have an auth config setup
2 parents a6c8490 + c88167b commit f2cd973

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/com/github/dockerjava/core/DockerClientImpl.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,13 @@ public PullImageCmd pullImageCmd(String repository) {
126126

127127
@Override
128128
public PushImageCmd pushImageCmd(String name) {
129-
return new PushImageCmdImpl(getDockerCmdExecFactory()
130-
.createPushImageCmdExec(), name).withAuthConfig(dockerClientConfig.effectiveAuthConfig(name));
129+
PushImageCmd cmd = new PushImageCmdImpl(getDockerCmdExecFactory()
130+
.createPushImageCmdExec(), name);
131+
132+
AuthConfig cfg = dockerClientConfig.effectiveAuthConfig(name);
133+
if( cfg != null )
134+
cmd.withAuthConfig(cfg);
135+
return cmd;
131136
}
132137

133138
@Override

0 commit comments

Comments
 (0)