Docker Maven Plugin Push to Dockerhub

721 views
Skip to first unread message

Ben Gill

unread,
Apr 5, 2016, 10:09:14 AM4/5/16
to fabric8
Hi,

I am having trouble getting push to work to my personal DockerHub registry.  I have tried a number of combinations, but none seem to work:


<registry>registry.hub.docker.com:443</registry>

<image>
<alias>base-web</alias>
<name>base-web</name>

<!-- https://registry.hub.docker.com/repos/<my username> is resolvable -->
<registry>registry.hub.docker.com:443</registry>

<build>
<assembly>
<dockerFileDir>base-web</dockerFileDir>
</assembly>
</build>
</image>  

I have tried an auth setting using properties, <authConfig> and 

It is not clear to me what the relationship is between docker.io and dockerhub, or what the URL scheme is behind personal / org scoped Dockerhub repositories.

Is there an example anywhere?

Kind Regards

Roland Huss

unread,
Apr 5, 2016, 10:28:14 AM4/5/16
to fab...@googlegroups.com
Hi,
> I am having trouble getting push to work to my personal DockerHub
> registry. I have tried a number of combinations, but none seem to work:

Do you mean your personal account on DockerHub (the public registry) ?
If so, then you dont need to configure any extra registry, since this is
the default.

> I have tried an auth setting using properties, <authConfig> and

Indeed you need to authenticate with your DockerHub account's
credentials. The recommended way is to do this in your
~/.m2/settings.xml as described in
http://fabric8io.github.io/docker-maven-plugin/authentication.html

For a first check -Ddocker.username=... -Ddocker.password=... on the
command line would do, too.

> It is not clear to me what the relationship is between docker.io and
> dockerhub, or what the URL scheme is behind personal / org scoped
> Dockerhub repositories.

Your account needs to be configured as the user part of the image name.
So, in your example you want an image "base-web" and your account is
"ben" then you should use a <name>ben/base-web</name> in the configuration.

In general, the image name is "registry/user/image-name:tag", however
the registry part can be omitted when talking to DockerHub or when using
the <registry>private-registry</registry> part.

cheers ...
... roland


> Is there an example anywhere?
>
> Kind Regards
>
> --
> You received this message because you are subscribed to the Google
> Groups "fabric8" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to fabric8+u...@googlegroups.com
> <mailto:fabric8+u...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Ben Gill

unread,
Apr 5, 2016, 10:57:17 AM4/5/16
to fabric8
Hi,


Do you mean your personal account on DockerHub (the public registry) ?
If so, then you dont need to configure any extra registry, since this is
the default.

Yes my personal account on DockerHub.  Ok, I have removed the registry setting. 

> I have tried an auth setting using properties, <authConfig> and

Indeed you need to authenticate with your DockerHub account's
credentials. The recommended way is to do this in your
~/.m2/settings.xml as described in
http://fabric8io.github.io/docker-maven-plugin/authentication.html

For a first check -Ddocker.username=...  -Ddocker.password=... on the
command line would do, too.
 

> It is not clear to me what the relationship is between docker.io and
> dockerhub, or what the URL scheme is behind personal / org scoped
> Dockerhub repositories.

Your account needs to be configured as the user part of the image name.
So, in your example you want an image "base-web" and your account is
"ben" then you should use a <name>ben/base-web</name> in the configuration.

In general, the image name is "registry/user/image-name:tag", however
the registry part can be omitted when talking to DockerHub or when using
the <registry>private-registry</registry> part.

Ok, so all I need is ben/image-name, when I do that, I get this:

[INFO] DOCKER> ... The push refers to a repository [docker.io/bendg25/base-web]


[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.14.2:push (default-cli) on project docker: Unable to push 'bendg25/base-web': Repository does not exist: bendg25/base-web -> [Help 1]

Roland Huss

unread,
Apr 5, 2016, 11:00:55 AM4/5/16
to fab...@googlegroups.com

> Ok, so all I need is ben/image-name, when I do that, I get this:
>
> [INFO] DOCKER> ... The push refers to a repository
> [docker.io/bendg25/base-web]
>
>
> [ERROR] Failed to execute goal
> io.fabric8:docker-maven-plugin:0.14.2:push (default-cli) on project
> docker: Unable to push 'bendg25/base-web': Repository does not exist:
> bendg25/base-web -> [Help 1]

You need to docker:build the image first so that it is available in your
Docker daemon (you must be able to see it with 'docker images'). The
push always goes from Docker daemon --> Docker registry (not directly).


... roland

Ben Gill

unread,
Apr 5, 2016, 1:33:28 PM4/5/16
to fabric8
Hi,

Thanks Roland, that has sorted it out.  So basically I have ommited the repository and just added <docker hub user id>/<my image name> and it works fine (using -Ddocker.username=foo -Ddocker.password=bar authentication properties).

Regards
Reply all
Reply to author
Forward
0 new messages