Remote deploy with maven?

982 views
Skip to first unread message

kurr...@gmail.com

unread,
Jan 22, 2017, 5:22:42 PM1/22/17
to fabric8
Hello

I'm unable to use Jenkins to build due to a bug in the Kubernetes plugin, so I'm hoping we can deploy to the remote OpenShift sever from our local development computers using Maven. Is this possible?

I see in the docs there is a fabric8:deploy goal - https://maven.fabric8.io/#fabric8:deploy - but I'm not clear on where I specify the url for the remote openshhift cluster.

Can someone please tell me where and how I specifiy the address for the openshift cluster to deploy to?

Thanks

kurr...@gmail.com

unread,
Jan 22, 2017, 5:46:09 PM1/22/17
to fabric8
I have also tried deploying using the OpenShift plugin in Jboss Developer Studio.

Is the following the correct address for the remote docker registry?



I was able to browse to the docker image, and I think I entered the right information, however I again was not able to deploy - and this time it was another timeout.

Does anyone know how to fix this?


Thanks


James Rawlings

unread,
Jan 24, 2017, 3:03:02 AM1/24/17
to kurr...@gmail.com, fab...@googlegroups.com
What bug in the kubernetes plugin are you having that's preventing you from using Jenkins?  

FWIW we include a patched version of the kubernetes plugin to include fixes that aren't release yet but exist in master.  This plugin is quite up to dat so I wouldn't expect you to have any bugs there.  

--
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.
For more options, visit https://groups.google.com/d/optout.

kurr...@gmail.com

unread,
Jan 24, 2017, 5:20:41 PM1/24/17
to fabric8, kurr...@gmail.com
I have a list of issues that we have been facing. I think there is 9 different issues.

The latest is the Jenkins slave is failing to mount, so the build hangs.



Is it possible to deploy our projects remotely? While I would like to be able to use Jenkins we are not making any progress, and we in desperate need to get our products deployed.  

I see there is a maven deploy command, but I could not understand how this works. I was expecting there would be a url parameter. But did not see one.

Any help is appreciated.


James Rawlings

unread,
Jan 24, 2017, 5:52:36 PM1/24/17
to kurr...@gmail.com, fab...@googlegroups.com
Hi - sorry you've been having a hard time getting going.  It's been a little hard to keep track of the problems you face and have managed to resolve when we use the mailing list.

I have a list of issues that we have been facing. I think there is 9 different issues.
Would you mind making sure the 9 different issues are raised on the fabric8 issue tracker please?  Including details of your setup and any steps to reproduce or error logs so it's easier to work on specific issues and close them off please?  Perhaps even reply to this mail with the issue links for others following this post.  We'll do our best to help.  

The latest is the Jenkins slave is failing to mount, so the build hangs.
This looks like an openshift issue, I saw problems with older versions of kubernetes mounting PVs.  Can you check the api server and kublet logs please?

Is it possible to deploy our projects remotely? 
If you're developing using java then yes you can build the image locally and push images to the remote docker registry using the fabric8 maven plugin.  Make sure you have the remote address as an insecure registry in your local machine docker options.  More details https://maven.fabric8.io/#fabric8:push

Thanks James.


Anton

unread,
Jan 24, 2017, 6:00:17 PM1/24/17
to James Rawlings, fab...@googlegroups.com
Hi James

Yes, we have an internal list, and have opened bugs where it seems applicable, many of the issues we are facing are existing bugs.

On Tue, Jan 24, 2017 at 11:52 PM, James Rawlings <rawli...@gmail.com> wrote:
If you're developing using java then yes you can build the image locally and push images to the remote docker registry using the fabric8 maven plugin.  Make sure you have the remote address as an insecure registry in your local machine docker options.  More details https://maven.fabric8.io/#fabric8:push

I have been studying this - and it still is not clear.

I get that I need to specify a registry. And the example is clear.

But I'm unsure of where I find the details for my registry. 
Where do I find what url I should use?
How do I expose this publicly? Or do I need to specify a username / password?


It looks like I have several registries running - its that correct?
$ kubectl get pods --all-namespaces 
NAMESPACE      NAME                               READY     STATUS             RESTARTS   AGE
default        configmapcontroller-1-q1a4o        1/1       Running            0          5h
default        docker-registry-1-rpjay            1/1       Running            1          11h
default        exposecontroller-3-jqugz           1/1       Running            0          5h
default        fabric8-3-tysqa                    1/1       Running            0          5h
default        fabric8-docker-registry-2-5d4xh    0/1       Init:0/1           0          1h
default        fabric8-docker-registry-2-deploy   1/1       Running            0          1h
default        fabric8-forge-1-dxysn              1/1       Running            0          5h
default        router-1-j55kk                     1/1       Running            1          11h
fabric8        configmapcontroller-1-noud9        1/1       Running            0          5h
fabric8        exposecontroller-2-ysnoq           1/1       Running            0          2h
fabric8        fabric8-2-0cltr                    1/1       Running            0          5h
fabric8        fabric8-docker-registry-1-r53cs    1/1       Running            0          5h
fabric8        fabric8-forge-1-cabd8              1/1       Running            0          5h
fabric8        gogs-2-qvfk9                       1/1       Running            0          5h
fabric8        jenkins-1-xodjn                    1/1       Running            0          1h
fabric8        nexus-1-o482o                      1/1       Running            0          5h

Anton

unread,
Jan 24, 2017, 6:06:36 PM1/24/17
to James Rawlings, fab...@googlegroups.com
Ah, https://maven.fabric8.io/#openshift-and-kubernetes-access this looks helpful!

Ok, will try this tomorrow.

Thanks James

James Rawlings

unread,
Jan 24, 2017, 6:18:30 PM1/24/17
to Anton, fab...@googlegroups.com
It would still be really handy for you to list (with github issue tracker links) the 9 different fabric8 issues you're having.  It's hard to track over email and match github user ids to mailing list users.
This is only useful for when you're developing locally using minishift or minikube and you can expose the docker socket from each VM to build the docker image.  This wont help when you have a remote openshift cluster, you'll need to push the image to the fabric8 docker registry using the openshift route.

FWIW here is an example I've used in the past to push a locally built docker image using fabric8-maven-plugin to a remote fabric8 docker registry.  The -Ddocker.push.registry parameter uses the openshift route URL that you can get from running 'oc get routes'

mvn fabric8:build fabric8:push fabric8:deploy -Ddocker.push.registry=fabric8-docker-registry.default.example.fabric8.io

I'm in the UK timezone, not sure about you but there's quite a few of us that hang out on IRC / Slack as I mentioned yesterday.  Perhaps we can catch up tomorrow?  

Also please reply with that list of issues so that it's easier to track, help and resolve.

Thanks!

kurr...@gmail.com

unread,
Jan 26, 2017, 7:27:32 AM1/26/17
to fabric8, kurr...@gmail.com, bahadyr baimuratov
Hi James

We (Bahadyr, CC'ed) have been trying to deploy with Maven.

We are having problems getting getting images from our registry, but it works when we use public docker hub.

@Bahadyr - please feel reply with more specific details.


kurr...@gmail.com

unread,
Jan 26, 2017, 9:12:49 AM1/26/17
to fabric8
Hi James

Are you able to reply here wtih the advice you gave.

I kept getting disconnected from IRC, then I would type a response and it wouldnt be sent. And I'm afraid we missed some of your valuable information.

Thanks

James Rawlings

unread,
Jan 26, 2017, 9:23:18 AM1/26/17
to kurr...@gmail.com, fab...@googlegroups.com
Sure thing FWIW the IRC transcripts can be found here http://transcripts.jboss.org/channel/irc.freenode.org/%23fabric8/latest.log.html

So you want to use the openshift docker registry rather than the fabric8 docker regsitry?  I must admit I've not tried to use the fabric8-maven-plugin to push to the openshift registry from outside the cluster but as long as your openshift auth is set up and openshift project name matches the docker image org name it should work.

You should be able to find the openshift registry URL using `oc get routes --all-namespaces --show-all  -a`

I think the route name you're looking for would be something like 'docker-registry' and when I checked on am openshift cluster here the registry was running in the default namespace (but that could be different in your setup)

I still dont know what isn't working so cant really help too much at the moment.  Did you try my suggestion in that post?  The example I gave was `mvn fabric8:build fabric8:push fabric8:deploy -Ddocker.push.registry=fabric8-docker-registry.default.example.fabric8.io`

to get the URL for the fabric8 docker registry you can run `gofabric8 service fabric8-docker-registry -u`

You will also need to add update your docker config from the machine you are pushing the docker image from to include the hostname in the docker '--insecure-registry' list and restart the docker service

Hope that helps. If not can you give me the steps you are taking along with any error messages you are seeing please.

kurr...@gmail.com

unread,
Jan 26, 2017, 9:30:48 AM1/26/17
to fabric8, kurr...@gmail.com, bahadyr baimuratov
Thanks James.
What is the difference between the fabric8 registry and the openshift registry?

James Rawlings

unread,
Jan 26, 2017, 9:40:47 AM1/26/17
to kurr...@gmail.com, fab...@googlegroups.com, bahadyr baimuratov
The fabric8 registry is unsecured, it's mainly there because we support running on any kubernetes cluster as well as OpenShift.  

When running on OpenShift we recommend using the OpenShift registry along with the OpenShift binary source + ImageStreams which the fabric8 Jenkins pipelines do out of the box without changes needed by users.  I.e. our pipelines use the best way to build push and pull images depending on which type of kubernetes based distro people are using.

This was why I was asking about the original issue with using Jenkins as this should all work OOTB.  Any problems need to be fixed asap.

I've not tried using the fabric8-maven-plugin to push an image directly to the OpenShift registry (I suspect others reading have) but as long as you're authorised and the openshift project name matches the docker image org name it should work.


On 26 Jan 2017, at 14:30, kurr...@gmail.com wrote:

Thanks James.
What is the difference between the fabric8 registry and the openshift registry?

kurr...@gmail.com

unread,
Jan 26, 2017, 11:49:29 AM1/26/17
to fabric8, kurr...@gmail.com, bah...@gmail.com
Hi James

I'm trying 'mvn fabric8:build fabric8:push fabric8:deploy -Ddocker.push.registry=fabric8-docker-registry.default.mydomain.com'

<plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.14.2</version>
                <configuration>
                    <images>
                        <image>
                            <name>shiftwork/shiftwork:latest</name>
                            <build>
                                <from>${docker.from}</from>
                                <assembly>
                                    <basedir>/app</basedir>
                                    <descriptorRef>${docker.assemblyDescriptorRef}</descriptorRef>
                                </assembly>
                                <ports>
                                    <port>8080</port>
                                </ports>
                                <cmd>
                                    <shell>java -jar /app/${project.artifactId}-${project.version}.war --spring.profiles.active=prod</shell>
                                </cmd>
                            </build>
                        </image>
                    <authConfig>
     <push>
        <username>xxx</username>
        <password>xxx</password>
     </push>
   </authConfig>
                    </images>
                </configuration>
            </plugin>

But this results in:

[INFO] <<< fabric8-maven-plugin:3.1.49:build (default-cli) < initialize @ shiftwork <<<
[INFO] 
[INFO] --- fabric8-maven-plugin:3.1.49:build (default-cli) @ shiftwork ---
[INFO] F8> Running in Kubernetes mode
[INFO] F8> Running generator spring-boot
[INFO] F8> Running generator java-exec
[WARNING] F8> None of the resolved images [%g/%a:%t] match the docker.image filter 'shiftwork/shiftwork:0.0.1-SNAPSHOT
[ERROR] F8> Cannot create docker access object 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------


Any ideas why this is not working?

James Strachan

unread,
Jan 26, 2017, 12:08:51 PM1/26/17
to kurr...@gmail.com, fabric8, bah...@gmail.com
The "Cannot create docker access object " typically means your maven process can't talk to the docker socket (either on your laptop or the cluster you've pointed DOCKER_HOST at).

The simplest option to do local development is to install minikube or minishift locally then its easy to do local builds against your local cluster without worrying about docker registy pushes or installing local docker.

If you want to build locally using docker images but not use minishift/minikube but still push to a remote registry, you need to install a local docker install so that you can actually build docker images on your laptop.

The other option is to setup S2I builds or Jenkins builds on the cluster and just git push and build them on the cluster (which has docker).





--
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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
James
-------
Red Hat

Twitter: @jstrachan
Email: james.s...@gmail.com
Blog: https://medium.com/@jstrachan/

open source development platform

open source event based lambda programming

Anton

unread,
Jan 26, 2017, 12:20:19 PM1/26/17
to James Strachan, fabric8, bahadyr baimuratov
Hi James, and thanks for your reply.

On Thu, Jan 26, 2017 at 6:08 PM, James Strachan <james.s...@gmail.com> wrote:
The "Cannot create docker access object " typically means your maven process can't talk to the docker socket (either on your laptop or the cluster you've pointed DOCKER_HOST at).
Ok, any suggestions on how to fix this? 

The simplest option to do local development is to install minikube or minishift locally then its easy to do local builds against your local cluster without worrying about docker registy pushes or installing local docker.
Ok, but we need to get our apps deployed onto the server. Im not sure if this helps. 


If you want to build locally using docker images but not use minishift/minikube but still push to a remote registry, you need to install a local docker install so that you can actually build docker images on your laptop.
Yes I have docker installed locally.  

The other option is to setup S2I builds or Jenkins builds on the cluster and just git push and build them on the cluster (which has docker).
We will revisit jenkins again once we can invest more time, and probably rebuild the server, but for now there is only one priority - get apps online asap. 


James Strachan

unread,
Jan 26, 2017, 12:33:52 PM1/26/17
to Anton, fabric8, bahadyr baimuratov
On 26 January 2017 at 17:19, Anton <kurr...@gmail.com> wrote:
Hi James, and thanks for your reply.

On Thu, Jan 26, 2017 at 6:08 PM, James Strachan <james.s...@gmail.com> wrote:
The "Cannot create docker access object " typically means your maven process can't talk to the docker socket (either on your laptop or the cluster you've pointed DOCKER_HOST at).
Ok, any suggestions on how to fix this? 

Your DOCKER env vars need to point to where docker is running. e.g. DOCKER_HOST / DOCKER_CERT_PATH et al


 
The simplest option to do local development is to install minikube or minishift locally then its easy to do local builds against your local cluster without worrying about docker registy pushes or installing local docker.
Ok, but we need to get our apps deployed onto the server. Im not sure if this helps. 

There's local development and local testing; then doing CD; for the latter building on the cluster post commit/push is simplest. For local building minikube/minishift is simplest; but you shoudl also be able to use local docker installs and push to global docker registries too. (They are complex to setup mind).

See if you can do a docker build first; once you can do that then you can try figure out how to do the right docker push to push from your laptop to the global docker registry you're using.

If you're using s2i and openshift then there's no need for the docker push part; as S2I does that bit for you; so that'll be simpler.

-------

Anton

unread,
Jan 26, 2017, 12:54:19 PM1/26/17
to James Strachan, fabric8, bahadyr baimuratov
On Thu, Jan 26, 2017 at 6:33 PM, James Strachan <james.s...@gmail.com> wrote:
On Thu, Jan 26, 2017 at 6:08 PM, James Strachan <james.s...@gmail.com> wrote:
The "Cannot create docker access object " typically means your maven process can't talk to the docker socket (either on your laptop or the cluster you've pointed DOCKER_HOST at).
Ok, any suggestions on how to fix this? 

Your DOCKER env vars need to point to where docker is running. e.g. DOCKER_HOST / DOCKER_CERT_PATH et al


Global configuration parameters specify overall behavior like the connection to the Docker host. The corresponding system properties which can be used to set it from the outside are given in parentheses.

Does this mean host, as in the host server, our remote server?


The docker-maven-plugin uses the Docker remote API so the URL of your Docker Daemon must somehow be specified. The URL can be specified by the dockerHost or machine configuration, or by the DOCKER_HOST environment variable.

Again, when it says remote api, this means our remote server?


The Docker remote API supports communication via SSL and authentication with certificates. The path to the certificates can be specified by the certPath or machine configuration, or by the DOCKER_CERT_PATH environment variable.

Do we need to have certificates installed? Should we expect errors if we dont?




 



 
The simplest option to do local development is to install minikube or minishift locally then its easy to do local builds against your local cluster without worrying about docker registy pushes or installing local docker.
Ok, but we need to get our apps deployed onto the server. Im not sure if this helps. 

There's local development and local testing; then doing CD; for the latter building on the cluster post commit/push is simplest. For local building minikube/minishift is simplest; but you shoudl also be able to use local docker installs and push to global docker registries too. (They are complex to setup mind).

See if you can do a docker build first; once you can do that then you can try figure out how to do the right docker push to push from your laptop to the global docker registry you're using.

If you're using s2i and openshift then there's no need for the docker push part; as S2I does that bit for you; so that'll be simpler.
We used to use Jenkins - and it worked perfectly.
Unfortunately, due to a bug in OpenShift, we cant get it to run.
We will need to rebuild /reinstall OpenShift to fix this. And currently our priority is to do this later, and now just get apps deployed asap.


James Strachan

unread,
Jan 26, 2017, 1:02:06 PM1/26/17
to Anton, fabric8, bahadyr baimuratov
On 26 January 2017 at 17:53, Anton <kurr...@gmail.com> wrote:

On Thu, Jan 26, 2017 at 6:33 PM, James Strachan <james.s...@gmail.com> wrote:
On Thu, Jan 26, 2017 at 6:08 PM, James Strachan <james.s...@gmail.com> wrote:
The "Cannot create docker access object " typically means your maven process can't talk to the docker socket (either on your laptop or the cluster you've pointed DOCKER_HOST at).
Ok, any suggestions on how to fix this? 

Your DOCKER env vars need to point to where docker is running. e.g. DOCKER_HOST / DOCKER_CERT_PATH et al


Global configuration parameters specify overall behavior like the connection to the Docker host. The corresponding system properties which can be used to set it from the outside are given in parentheses.

Does this mean host, as in the host server, our remote server? 


The docker-maven-plugin uses the Docker remote API so the URL of your Docker Daemon must somehow be specified. The URL can be specified by the dockerHost or machine configuration, or by the DOCKER_HOST environment variable.

Again, when it says remote api, this means our remote server?

If you want to build locally using your local docker install then this is the local docker daemon env vars.

Otherwise you need to expose the docker daemon on one of your servers (which is what minikube + minishift do OOTB)


 
The Docker remote API supports communication via SSL and authentication with certificates. The path to the certificates can be specified by the certPath or machine configuration, or by the DOCKER_CERT_PATH environment variable.
Do we need to have certificates installed? Should we expect errors if we dont?

Depends on how you installed docker.

If you've installed docker on your laptops then the env vars should all be setup for you?

It may just be you need to define DOCKER_HOST to point to the host/port

--
James

-------
Red Hat

Twitter: @jstrachan
Email: james.s...@gmail.com

kurr...@gmail.com

unread,
Jan 26, 2017, 1:03:21 PM1/26/17
to fabric8
I have tried each of these options as the docker host, but get the same error with each:

$ whereis docker
docker: /usr/bin/docker /usr/lib/docker /etc/docker /usr/share/man/man1/docker.1.g

Below is the setting Ive used.


<plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.14.2</version>
                <configuration>
                <dockerHost>/etc/docker</dockerHost>
                <registry>abric8-docker-registry.default.openshift.mydomain.co:443</registry>

Error

kurr...@gmail.com

unread,
Jan 26, 2017, 1:06:11 PM1/26/17
to fabric8
I ran:

$ gofabric8 docker-env
Context fabric8/openshift-mydomain-co:8443/admin not supported.  Currently only CDK, Minishift and Minikube are supported

Can someone clarify this?

Does this mean we cannot deploy using maven?

Anton

unread,
Jan 26, 2017, 1:14:31 PM1/26/17
to James Strachan, fabric8, bahadyr baimuratov
Thanks James

On Thu, Jan 26, 2017 at 7:01 PM, James Strachan <james.s...@gmail.com> wrote:

If you've installed docker on your laptops then the env vars should all be setup for you?

Yes,  I installed Docker on my laptop (ubuntu) just by following the instructions on the docker website.
 
It may just be you need to define DOCKER_HOST to point to the host/port
Ok. 
Apologies for asking what are probably annoying questions.
But how do I find my docker host and port?
Ive never need this info before.

James Strachan

unread,
Jan 27, 2017, 4:20:13 AM1/27/17
to Anton, fabric8, bahadyr baimuratov
I guess you've never used the docker daemon from Java before?


You need to tell Java where the docker daemon is right now. By default its on the unix socket; I'm not sure if the underlying docker maven plugin can handle unix sockets yet; so you need to point it to the host+port where its running.

e.g. tcp://127.0.0.1:2376

or maybe on 2375 - depends which port its running & whether its using https or not. Docker should have setup all your other env vars for certs and stuff

Roland Huss

unread,
Jan 27, 2017, 4:40:01 AM1/27/17
to James Strachan, Anton, fabric8, bahadyr baimuratov
d-m-p by default uses the Unix socket (like Docker CLI does itself). Please be sure that your DOCKER_HOST variable is unset then. Also, please use "-e" option to Maven so that a stacktrace can be seen. If this doesn't work for you, please open an issue at https://github.com/fabric8io/fabric8-maven-plugin so we can work together on it to resolve this.

thanks ...
... roland


--
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.

For more options, visit https://groups.google.com/d/optout.
--
... roland

James Strachan

unread,
Jan 27, 2017, 4:41:27 AM1/27/17
to Roland Huss, Anton, fabric8, bahadyr baimuratov
On 27 January 2017 at 09:39, Roland Huss <rolan...@gmail.com> wrote:
d-m-p by default uses the Unix socket (like Docker CLI does itself).

Ah awesome! :)

 
To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
... roland

--
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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

kurr...@gmail.com

unread,
Jan 27, 2017, 5:50:31 PM1/27/17
to fabric8, james.s...@gmail.com, kurr...@gmail.com, bah...@gmail.com
Thanks Roland

I have installed OpenShift 1.4.1, and Fabric8 - so everything is freshly installed - following the instructions.
And the new version of OpenShift means that the bug that was preventing us from using Jenkins is resolved. 

So I have been trying to deploy using Jenkins. And am having basically the same error as I described  in this thread. 

The detailed output is on this thread - https://groups.google.com/forum/#!topic/fabric8/IxpDpNLKBKo

Thanks

Roland Huß

unread,
Jan 27, 2017, 6:00:23 PM1/27/17
to fabric8, kurr...@gmail.com, bah...@gmail.com


On Thursday, January 26, 2017 at 5:49:29 PM UTC+1, Anton wrote:
Hi James

I'm trying 'mvn fabric8:build fabric8:push fabric8:deploy -Ddocker.push.registry=fabric8-docker-registry.default.mydomain.com'

<plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>


Why are you using the docker-maven-plugin here and not the fabric8-maven-plugin ? fabric8-maven-plugin v3 embedds docker-maven-plugin itself. Can you please post the configuration of the fabric8-maven-plugin (this config is not triggered mvn fabric8:...)

... roland

kurr...@gmail.com

unread,
Jan 27, 2017, 7:57:48 PM1/27/17
to fabric8, kurr...@gmail.com, bah...@gmail.com
I have used f-m-p and d-m-p. 
No joy with either. 

kurr...@gmail.com

unread,
Jan 27, 2017, 8:16:14 PM1/27/17
to fabric8, kurr...@gmail.com, bah...@gmail.com
Even after hardcoding the image name:

<plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>fabric8-maven-plugin</artifactId>
                <version>3.1.49</version>
                <configuration>
                <dockerHost>tcp://f8registry.openshift.mydomain.co:2375</dockerHost>
                <image>shiftwork/staffservice:latest</image>
                </configuration>

We still get this:

+ docker tag staffrostering/shiftwork:1.0.60 172.30.254.212:80/staffrostering/shiftwork:1.0.60
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

There is no where else that we are setting the image. 

Roland Huss

unread,
Jan 28, 2017, 5:13:27 AM1/28/17
to kurr...@gmail.com, fabric8, bah...@gmail.com
Hi Kurt,

I'm really sorry that you have such a bad experience now and apologize for it. Although fabric8 to make stuff as easy as possible, still some basic Docker and Kubernetes knowledge is indispensable.

'hope it's ok, when I try to clarify some stuff (even if might be trivial and well known to you already):

* Kubernetes is an orchestration platform on top of Docker. This means that K8s itself runs on Docker as well that it manages Docker containers.
* So what is Docker ? Docker is tool suite for easy managing Linux container. It has a client-server architecture where the client speaks to the server via HTTP or HTTPS. This can be done either locally via a Unix socket or remotely via TCP.
* One feature of Docker is that is support sharing of so called images (these are the blueprints for containers) via "registries". This are _different_ server which are listening remotely on a port and a called by the Docker daemon only when a client does a push. So, when you do a push to a registry the request flow goes like : client (cli or our maven plugin) --> Docker daemon --> Registry. The same for pulling images. As you can see, the client *never* contacts the registry directly.
* Fabric8 provides two plugins which have quite different purposes:
  - docker-maven-plugin : This is for handling Docker only (no K8s). It needs access to a Docker daemon and can build image, push images, run containers, ... but all Docker only. It supports talking with the Docker daemon either via local Unix Sockets or via TCP connections and extract the connections parameters either from environment variables (like DOCKER_HOST) or via a configuration in the pom.xml
 - fabric8-maven-plugin is the plugin for managing apps for Kubernetes and/or OpenShift. It also knows how to build on these platforms. For Kubernetes, it uses again a plain Docker daemon and hence embeds docker-maven-plugin for this purpose. So, when you want to build with f-m-p you have the same connection possibilities to the Docker daemon. When you use fabric8-maven-plugin you don't need docker-maven-plugin. In fact this can be even cause interference problems.

Both plugins are fairly good documented, although the documentation for d-m-p is more matured.

So, coming back to the configuration snippets you posted, I try to guess now what is happening. Its hard to extract the full case from that many mails, but I try my best:

* You should not have docker-maven-plugin in your pom.xml
* The dockerHost "tcp://f8registry.openshift.mydomain.co:2375" looks complete wrong, as it points to a *registry* not a *Docker daemon*. Also it looks like you are using OpenShift so using the Docker build mode is not recommended but one of the OpenShift specific modes, s2i binary build is prefered. There you dont need a Docker daemon at all. But you should set the fabric8.mode to openshift to be sure (it should be auto detected via the API, though).
* Do *not* specify an image with `<image>` as it is supposed to be a filter and will work if you have an image configuration with `<images><image><name>...` with this name. Please remove this line.
* Please use the latest version of f-m-p which is 3.2.15, 3.1.49 is already quite old.

This is all I can say from my part and from the information at hand. For CD related issues, James is already trying to help you.

Hope this clarifies things a bit and sorry again ....
... roland


--
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.
For more options, visit https://groups.google.com/d/optout.
--
... roland

kurr...@gmail.com

unread,
Jan 31, 2017, 3:33:00 PM1/31/17
to fabric8
Thanks Roland, this is very helpful.

I have been using docker for a few years, and OpenShift with Fabric8 for about a year, yet there is still a lot to learn.

We use docker-compose for local development, and this works really well. Its exceptionally simple! 
Is there anyway we can re-use these existing dockerfiles/images in OpenShift?

Thanks

kurr...@gmail.com

unread,
Jan 31, 2017, 5:49:20 PM1/31/17
to fabric8
Roland,

Perhaps you can help.

Below is our old Jenkinsfile - which worked perfectly. Unfortunately we upgraded and have spent the past month just trying to get operational again.
While we are making progress we still have not yet managed to successfully deploy our apps.

When we try to run the old Jenkinsfile, it results in this error:

hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: static io.fabric8.kubernetes.pipeline.Kubernetes.withPrivileged() is applicable for argument types: (java.lang.Boolean) values: [true]

Do you know how we can have a working jenkinsfile a similar to the below, that works?

#!/usr/bin/groovy
def failIfNoTests = ""
try {
  failIfNoTests = ITEST_FAIL_IF_NO_TEST
} catch (Throwable e) {
  failIfNoTests = "false"
}

def itestPattern = ""
try {
  itestPattern = ITEST_PATTERN
} catch (Throwable e) {
  itestPattern = "*KT"
}

def versionPrefix = ""
try {
  versionPrefix = VERSION_PREFIX
} catch (Throwable e) {
  versionPrefix = "1.0"
}

def canaryVersion = "${versionPrefix}.${env.BUILD_NUMBER}"
def utils = new io.fabric8.Utils()

node {
  def envProd = 'shiftwork-production'

  checkout scm

  kubernetes.pod('buildpod').withImage('<ip address>:80/shiftwork/jhipster-build')
      .withPrivileged(true)
      .withHostPathMount('/var/run/docker.sock','/var/run/docker.sock')
      .withEnvVar('DOCKER_CONFIG','/home/jenkins/.docker/')
      .withSecret('jenkins-docker-cfg','/home/jenkins/.docker')
      .withSecret('jenkins-maven-settings','/root/.m2')
      .withServiceAccount('jenkins')
      .inside {

    stage 'Canary Release'
    mavenCanaryRelease{
      version = canaryVersion
    }

    stage 'Integration Test'
    mavenIntegrationTest{
      environment = 'Testing'
      failIfNoTests = localFailIfNoTests
      itestPattern = localItestPattern
    }

    stage 'Rolling Upgrade Production'
    def rc = readFile 'target/classes/kubernetes.json'
    kubernetesApply(file: rc, environment: envProd)

  }
}


James Strachan

unread,
Feb 1, 2017, 12:24:09 AM2/1/17
to Anton, fabric8
you could look at this for reusing your docker compose files:

though the downside is you lose being able to do things like co-locate containers into a pod or use init containers or have nice lifecycle hooks etc. Thats why we prefer to generate the kuberentes resources for Java apps; e.g. we an detect Spring Boot or WildFly Swarm frameworks and automatically generate lifecycle hooks reusing the underlying Spring Boot Actuator or Swarm health checks etc.

For images you just need to push them into a docker registry; then refer to the images with the docker registry prefix in the image names

--
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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Anton

unread,
Feb 1, 2017, 4:21:44 PM2/1/17
to Roland Huss, fabric8, bahadyr baimuratov
Hi Roland

We think we have found our problem.

We need to build our own docker image, using an existing dockerfile. This is how we used to do it, and it worked. However the dsl has changed, and as a result we are stuck.






To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
... roland

Roland Huss

unread,
Feb 2, 2017, 1:40:57 AM2/2/17
to Anton, fabric8, bahadyr baimuratov
Hi Anton,

Sounds good, hope your issues will soon be solved. w.r.t to the CD pipeline I can't probably help you that much, but will track the issue, too.

... roland

To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
... roland

--
... roland

kurr...@gmail.com

unread,
Feb 2, 2017, 8:47:09 PM2/2/17
to fabric8, bahadyr baimuratov
We are basically taking two parallel tracks
  1. Deploy using Jenkins - we have several other threads and issues on this
  2. Deploy using Maven
For maven, how do we deploy using our own dockerfile? So we wish to push this to the OpenShift registry?

Thanks

Reply all
Reply to author
Forward
0 new messages