spotify / docker-maven-plugin

INACTIVE: A maven plugin for Docker
Apache License 2.0
2.66k stars 575 forks source link

Placeholder for user's name in the .dockercfg file #307

Closed igcherkaev closed 6 years ago

igcherkaev commented 7 years ago

Description

We'd like to use builder's username to prepend image names when we build docker images using the plugin. It would be nice to have some sort of placeholder to use in the pom.xml file. That'd allow developers to automatically build and push images to private repo under their assigned username.

How to reproduce

N/A, as this is a feature request.

What do you expect

E.g. if I had

 <imageName>${docker-registry}/${dockercfg.username}/${project.artifactId}</imageName>
 <useConfigFile>true</useConfigFile>

in my pom.xml file and the plugin automatically replaced ${dockercfg.username} with the username in the .dockercfg file being used for authentication, that'd be great. That way multiple developers working on the same project would have their own images uploaded to the registry.

The placeholder can also depend on how the auth is configured in the pom.xml file. If it's not based on the dockercfg, then it could read it from the settings.xml.

mattnworb commented 7 years ago

Have you tried to use an environment variable like ${env.USER} instead?

davidxia commented 6 years ago

closing due to inactivity. And we recommend users switch to https://github.com/spotify/dockerfile-maven. This project is now bug fix only mode.