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

OpenShift build requires connection to dockerd #138

Closed
flix- opened this issue Apr 1, 2020 · 0 comments · Fixed by #139
Closed

OpenShift build requires connection to dockerd #138

flix- opened this issue Apr 1, 2020 · 0 comments · Fixed by #139
Assignees
Labels
bug Something isn't working
Projects
Milestone

Comments

@flix-
Copy link

flix- commented Apr 1, 2020

An OpenShift build does not need a connection to a dockerd as the docker build takes place on the OpenShift cluster itself. However, jkube requires a valid dockerd configuration.

Reproduction steps:

  1. Create empty project and add jkube-maven-plugin with the following configuration:
<build>
  <plugins>
    <plugin>
      <groupId>org.eclipse.jkube</groupId>
      <artifactId>openshift-maven-plugin</artifactId>
      <version>1.0.0-alpha-1</version>
 
      <configuration>
        <mode>openshift</mode>
        <buildStrategy>docker</buildStrategy>
        <verbose>true</verbose>
      </configuration>
 
      <executions>
        <execution>
          <id>jkube</id>
            <goals>
              <goal>resource</goal>
              <goal>build</goal>
              <!--goal>deploy</goal-->
            </goals>
         </execution>
       </executions>
     </plugin>
   </plugins>
</build>
  1. Login to cluster using oc login and check whether token is written to ~/.kube/config
  2. mvn oc:build -X
[DEBUG] Trying to configure client from Kubernetes config...
[DEBUG] Found for Kubernetes config at: [C:\cygwin64\home\roland\.kube\config].
[INFO] oc: Running in OpenShift mode
[INFO] oc: Using OpenShift build with strategy Docker
[DEBUG] Trying to configure client from Kubernetes config...
[DEBUG] Found for Kubernetes config at: [C:\cygwin64\home\roland\.kube\config].
[DEBUG] Trying to configure client from Kubernetes config...
[DEBUG] Found for Kubernetes config at: [C:\cygwin64\home\roland\.kube\config].
[INFO] oc: Generators:
[INFO] oc:  - quarkus
[INFO] oc:  - spring-boot
[INFO] oc:  - wildfly-swarm
[INFO] oc:  - thorntail-v2
[INFO] oc:  - openliberty
[INFO] oc:  - karaf
[INFO] oc:  - vertx
[INFO] oc:  - java-exec
[INFO] oc:  - webapp
[INFO] oc: Running generator webapp
[INFO] oc: webapp: Using fabric8/tomcat-9:1.2.1 as base image for webapp
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.503 s
[INFO] Finished at: 2020-04-01T14:29:54+02:00
[INFO] Final Memory: 26M/319M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.jkube:openshift-maven-plugin:1.0.0-alpha-1:build (default-cli) on project 4711: Execution default-cli of goal org.eclipse.jkube:openshift-maven-plugin:1.0.0-alpha-1:build failed: No <dockerHost> given, no DOCKER_HOST environment variable, no read/writable '/var/run/docker.sock' or '//./pipe/docker_engine' and no external provider like Docker machine configured -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.jkube:openshift-maven-plugin:1.0.0-alpha-1:build (default-cli) on project 4711: Execution default-cli of goal org.eclipse.jkube:openshift-maven-plugin:1.0.0-alpha-1:build failed: No <dockerHost> given, no DOCKER_HOST environment variable, no read/writable '/var/run/docker.sock' or '//./pipe/docker_engine' and no external provider like Docker machine configured
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.eclipse.jkube:openshift-maven-plugin:1.0.0-alpha-1:build failed: No <dockerHost> given, no DOCKER_HOST environment variable, no read/writable '/var/run/docker.sock' or '//./pipe/docker_engine' and no external provider like Docker machine configured
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:145)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.IllegalArgumentException: No <dockerHost> given, no DOCKER_HOST environment variable, no read/writable '/var/run/docker.sock' or '//./pipe/docker_engine' and no external provider like Docker machine configured
    at org.eclipse.jkube.kit.build.service.docker.access.DockerConnectionDetector.detectConnectionParameter (DockerConnectionDetector.java:104)
    at org.eclipse.jkube.kit.build.service.docker.DockerAccessFactory.createDockerAccess (DockerAccessFactory.java:38)
    at org.eclipse.jkube.maven.plugin.mojo.build.BuildMojo.executeDockerBuild (BuildMojo.java:103)
    at org.eclipse.jkube.maven.plugin.mojo.build.BuildMojo.execute (BuildMojo.java:51)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
@manusa manusa added the bug Something isn't working label Apr 1, 2020
@manusa manusa added this to the 1.0.0 milestone Apr 1, 2020
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Apr 1, 2020
Remove check related to checking docker access in case of OpenShift builds
@manusa manusa added this to In Progress in Sprint #182 Apr 1, 2020
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Apr 1, 2020
Remove check related to checking docker access in case of OpenShift builds
@manusa manusa moved this from In Progress to Review in Sprint #182 Apr 1, 2020
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Apr 1, 2020
Remove check related to checking docker access in case of OpenShift builds
manusa pushed a commit that referenced this issue Apr 1, 2020
Remove check related to checking docker access in case of OpenShift builds
@manusa manusa moved this from Review to Done in Sprint #182 Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Sprint #182
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants