Skip to content
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

Registry authentication config in settings.xml #146

Closed
sverhagen opened this issue Apr 15, 2015 · 7 comments
Closed

Registry authentication config in settings.xml #146

sverhagen opened this issue Apr 15, 2015 · 7 comments
Assignees
Milestone

Comments

@sverhagen
Copy link
Contributor

When setting server credentials in settings.xml the id of the server is needed. The id of the registry is taken from the image name, see AuthConfigFactory.getRegistryFromImageNameOrDefault. If the image name does not include the registry, this method will always return registry.hub.docker.io, regardless of what's given in <registry> elements (either for the image or globally). I think this is wrong. My registry happens to be something-else, but <server> ... <id>something-else</id> ... in my settings.xml is subsequently ignored (as it is searching for registry.hub.docker.io.

I can work around this by using <id>registry.hub.docker.io</id> in my settings.xml, but that's flawed (I see at least the risk of inadvertently offering my private credentials, while contacting the public Docker Registry.

@rhuss
Copy link
Collaborator

rhuss commented May 15, 2015

You are absolutely right, that shouldn't be the case.

Sorry that I missed that issue (was busy lately but now after I have switched jobs I have more time to spend on this).

In fact the authentication info must be looked up from the registry provided (not only when specified as part of the name).

@sverhagen
Copy link
Contributor Author

As mentioned in elsewhere:

#146 is already fixed (but not yet pushed, need some better testing yet)

Would there be a 0.12.0-SNAPSHOT to test this on, I could try if it works for me now?

@rhuss
Copy link
Collaborator

rhuss commented May 18, 2015

Thanks ! I will push a 0.11.5-SNAPSHOT today with this fix and will let you know when I pushed it.

@rhuss
Copy link
Collaborator

rhuss commented May 18, 2015

I just made a release 0.11.5-M1 available from Maven central. It would be awesome if you could check this out. I believe that most of the registry issues are fixed and should now work as described in the documentation.

I will go through the issue and check them one-by-one.

Please let me know, whether this release works for you. A final 0.11.5 shouldn't be far away.

@rhuss rhuss added the fixed label May 18, 2015
@rhuss rhuss modified the milestones: 0.11.5, 0.12.0 May 18, 2015
@sverhagen
Copy link
Contributor Author

Tested this and it appears to be fixed. Thank you!

Would it be worth a new issue that the error message is so horribly undescriptive when there's no (correct) credentials in settings.xml?

[ERROR] DOCKER> EOF (Internal Server Error: 500)

@rhuss
Copy link
Collaborator

rhuss commented May 22, 2015

I think the error message are nowadays better. At least with a docker daemon 1.6.1 they final report back an "Authentication error". On what version of Docker do you receive this dumb error message ?

@rhuss rhuss closed this as completed May 22, 2015
@sverhagen
Copy link
Contributor Author

I'm seeing the "Authentication error" on newer installs, should be good.

leusonmario pushed a commit to leusonmario/docker-maven-plugin that referenced this issue Aug 18, 2018
Prior to this change, a mojo configuration like

```
<resource>
  <directory>some/directory</directory>
  <targetPath>/data</targetPath>
</resource>
```

would generate an `ADD /data /data` instruction but the `some/directory`
directory is never copied into the Docker build context directory, so
the actual build will fail.

With this change, the directory is copied to the build context
directory.

Note: it might seem weird that the `targetPath` is used as the directory
name to use *inside* the build context as opposed to just the target
path inside the container, but this is to mirror behavior when copying
individual files.

Fixes fabric8io#146.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants