-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authentication is required failure with 0.11.5 #181
Comments
Great... all the xml notation I added has been stripped. Sorry! |
(fixed the XML formatting, you need to embedd it in backticks. See the source, how) For the authentication to work, the server <server>
<id>docker.company.com</id>
<username>user</username>
<password>password</password>
</server> E-Mail ist not necessary. Please let me know if this works for you. |
I'm sorry this does not work form. [INFO] DOCKER> Step 0 : FROM docker.company.com/java8:latest This is from my .m2/settings.xml: docker.company.com username password simon.temple@company.comOn 26 May 2015 at 20:35, Roland Huß notifications@github.com wrote:
|
I have done some more testing and confirm this is only an issue if running The workaround for me is to stop using a custom Dockerfile in On 26 May 2015 at 20:35, Roland Huß notifications@github.com wrote:
|
Ah, good to know. Thanks. Might indeed be a bug, I will hunt for it :) |
It seems to be a bug when building a image with an external Dockerfile which has a base image from a private repository. In this case, the plugin doesn't send the correspondent credential, in consecuence it fails. private void autoPullBaseImage(DockerAccess dockerAccess, ImageConfiguration imageConfig)
throws DockerAccessException, MojoExecutionException {
BuildImageConfiguration buildConfig = imageConfig.getBuildConfiguration();
String fromImage = buildConfig.getFrom();
if (fromImage == null) {
AssemblyConfiguration assemblyConfig = buildConfig.getAssemblyConfiguration();
if (assemblyConfig == null || assemblyConfig.getDockerFileDir() == null) {
fromImage = DockerAssemblyManager.DEFAULT_DATA_BASE_IMAGE;
}
}
if (fromImage != null) {
checkImageWithAutoPull(dockerAccess, fromImage, new ImageName(fromImage).getRegistry(),true);
}
} Method autoPullBaseImage it only try to get the base image from "<from/>" tag, it doesn't read the "FROM" section of the Dockerfile. I don't if this was done on porpouse or is just a bug. |
Also, I'm seeing that the plugin is not sending the field "serveraddress" when authenticates. Based on Docker documentation, is required:
I'm testing the change and if work I'll send a pull-request. |
"serveradress" is only required when calling the It seem indeed an issue when using the external Dockerfile and I'm also not sure that it does any autopull when doing the the build (because I don't parse yet the dockerfile but use it 'as it'). I will have a look at it (but not before monday), but I'm open for any PR, so feel free to submit one ;-) thanks ... |
Based on these links the "serveradress" is required:
Maybe different versions of Docker behaves in a different way? My configuration
|
…serveraddress" to authentication header.
@jdavisonc private repo without |
Yes, If I add the tag on plugin configuration it works. |
Authentication support has been extended quite a bit since that time. I'm going to close this issue, but feel to reopen it or open a new issue if authentication still does not work as expected. |
When the Dockerfile processes the command:
It fails as our private repo requires authentication.
I have the following in my
.m2/settings.xml
:I also tried adding:
But I'm confused about this as the repo also requires email address when you login via docker:
docker login docker.company.com
BTW: This works and creates an entry in the .dockercfg file:
This is an extract from my mvn -X command:
TIA
Simon
The text was updated successfully, but these errors were encountered: