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

Better handling of private registries #26

Closed
jstrachan opened this issue Oct 9, 2014 · 3 comments
Closed

Better handling of private registries #26

jstrachan opened this issue Oct 9, 2014 · 3 comments
Assignees
Milestone

Comments

@jstrachan
Copy link
Contributor

sometimes folks wanna build stuff and push to the global registry; sometimes folks wanna push to a local registry. I wonder if the registry host should default to using an environment variable rather than a maven build property; as its kind of an environment thing?

e.g. I found we had to add these instructions to add a custom profile to ~/.m2/settings/xml to enable the 'default to env var' behaviour. I figured it might be nice to have this by default?
http://fabric8.io/v2/mavenPlugin.html#specifying-the-location-of-your-local-docker-registry

e.g. if a build is intended to use a private docker registry then maybe its better to get this from an environment variable?

@jstrachan
Copy link
Contributor Author

this is similar to #31; if docker.registry isn't specified as a mvn property it'd be nice to default to DOCKER_REGISTRY env var

@rhuss rhuss added this to the 0.10.6 milestone Dec 5, 2014
@rhuss rhuss changed the title use the ${env.DOCKER_REGISTRY} env var when using docker:build or docker:push? Allow the specification of a registry via an environment variable (DOCKER_ENV) Dec 11, 2014
@rhuss rhuss changed the title Allow the specification of a registry via an environment variable (DOCKER_ENV) Better handling of private registries Dec 11, 2014
@rhuss
Copy link
Collaborator

rhuss commented Dec 11, 2014

Let's reconsider the whole registry addressing stuff:

Currently it is only possible to specify a private registry as part of the image name, but a more flexible naming would be add some value.

My suggestion is:

  • If the image name contains a registry, then this registry has the highest precedence.
  • Otherwise, if the ImageConfiguration specifies a registry, take this.
  • Otherwise, if the global configuration contains a registry, take this for all images.
  • Otherwise check the system property docker.registry
  • Finally check an environment variable DOCKER_REGISTRY.

If an image is build, and the registry is not specified in the name, it should be tagged with the full name (including the registry found), too.

When it is pushed and the image to push is not 'fully' qualified (i.e. doesn't contain a registry part), but another than the default registry is configured, tag the image locally before pushing to the target registry (if this is required by docker, don't know this by heart)

@rhuss
Copy link
Collaborator

rhuss commented Mar 1, 2015

DOCKER_REGISTRY is now used as a fallback in 0.11.1 and later, so it should be safe. I'll close that one, please feel free to reopen it if it shouldn't work as expected (and described in the manual).

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

No branches or pull requests

2 participants