docker build fails in jhipster - docker

Can someone point me in the right direction for the error below?
I have DOCKER_HOST set (192.168.99.100:2376)
I entered the following command on my windows box:
mvnw package -Pprod docker:build -DskipTests -e
All works fine but, when building the image, I am getting the following error:
[ERROR] Failed to execute goal
com.spotify:docker-maven-plugin:0.4.10:build (default-cli) on project
truup: Exception caught: java.util.concurrent.ExecutionException:
com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException:
org.apache.http.client.ClientProtocolException: The server failed to
respond with a valid HTTP response -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal com.spotify:docker-maven-plugin:0.4.10:build
(default-cli) on project truup: Exception caught
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)

It sounds like what described at ClientProtocolException (Windows 10 using Docker Toolbox).
Check these environment variables:
set DOCKER_HOST=tcp://192.168.99.100:2376
set DOCKER_MACHINE_NAME=default
set DOCKER_TLS_VERIFY=1
set DOCKER_TOOLBOX_INSTALL_PATH=C:\Program Files\Docker Toolbox
set DOCKER_CERT_PATH=C:\Users\myuserhere.docker\machine\machines\default

Related

Helidon quickstart Docker build not finding parent specified in pom.xml

When I build the example in Maven it works fine; however when I try to do the docker build, it errors out. Has anyone else come across this or have a fix? I can build other docker images just fine. thanks in advance.
Here is my command line build results:
S:~/eclipse-workspace/helidon-quickstart-se$ docker build -t helidon-quickstart-se .
Sending build context to Docker daemon 65.54kB
Step 1/13 : FROM maven:3.6-jdk-11 as build
---> e23b595c92ad
Step 2/13 : WORKDIR /helidon
---> Using cache
---> 479d1d20bfa8
Step 3/13 : ADD pom.xml .
---> Using cache
---> d945f45c3d4c
Step 4/13 : RUN mvn package -Dmaven.test.skip -Declipselink.weave.skip
---> Running in 8b058d39dad3
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/io/helidon/applications/helidon-se/2.4.2/helidon-se-2.4.2.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for io.helidon.examples:helidon-quickstart-se:1.0-SNAPSHOT: Could not transfer artifact io.helidon.applications:helidon-se:pom:2.4.2 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/io/helidon/applications/helidon-se/2.4.2/helidon-se-2.4.2.pom and 'parent.relativePath' points at no local POM # line 7, column 13
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project io.helidon.examples:helidon-quickstart-se:1.0-SNAPSHOT (/helidon/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for io.helidon.examples:helidon-quickstart-se:1.0-SNAPSHOT: Could not transfer artifact io.helidon.applications:helidon-se:pom:2.4.2 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/io/helidon/applications/helidon-se/2.4.2/helidon-se-2.4.2.pom and 'parent.relativePath' points at no local POM # line 7, column 13: Unknown host repo.maven.apache.org: Temporary failure in name resolution -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/ProjectBuildingException
[ERROR] [Help 2] 'http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException..'
The command '/bin/sh -c mvn package -Dmaven.test.skip -Declipselink.weave.skip' returned a non-zero code: 1
I may be missing something, but isn't this simply a very basic problem with your connectivity to Maven Central? From the stack trace you posted:
Could not transfer artifact io.helidon.applications:helidon-se:pom:2.4.2 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/io/helidon/applications/helidon-se/2.4.2/helidon-se-2.4.2.pom and 'parent.relativePath' points at no local POM # line 7, column 13
But, as you can see, of course, the artifact most certainly does exist. Perhaps whatever is doing the fetching is behind a network proxy?

Maven Error Unknown host repo.maven.apache.org

I am trying to build a docker container using docker-compose build on a CentOS Linux release 8.2.2004. When I execute the command I get the following error message
[ERROR] Plugin org.apache.maven.plugins:maven-javadoc-plugin:3.1.1 or one of its dependencies could not be resolved:
Failed to read artifact descriptor for org.apache.maven.plugins:maven-javadoc-plugin:jar:3.1.1:
Could not transfer artifact org.apache.maven.plugins:maven-javadoc-plugin:pom:3.1.1 from/to central (https://repo.maven.apache.org/maven2):
Transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-javadoc-plugin/3.1.1/maven-javadoc-plugin-3.1.1.pom:
Unknown host repo.maven.apache.org: Temporary failure in name resolution -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/PluginResolutionException
ERROR: Service 'web' failed to build: The command '/bin/sh -c mvn clean package -am -DskipTests -Dmaven.javadoc.skip=true -P deployment' returned a non-zero code: 1
When I build the docker container on my local machine it works just fine. So there is no issue with the container or any configuration within. I have done some research which suggest there might be a proxy problem on the CentOS Server, but echo "$HTTP_PROXY" and echo "$HTTPS_PROXY" return an empty line - thus I suppose there is no proxy used.
Also when I execute curl https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-javadoc-plugin/3.1.1/maven-javadoc-plugin-3.1.1.pom I get a proper looking xml file.
When I execute curl https://repo.maven.apache.org/maven2I get
<html>
<head><title>302 Moved Temporarily</title></head>
<body>
<h1>302 Moved Temporarily</h1>
<ul>
<li>Code: Found</li>
<li>Message: Resource Found</li>
<li>RequestId: 235378792B04A00C</li>
<li>HostId: b2HKaI47VR5MaiW8bmG9FUGxgZ7u97XeT5Bfm/rs54wVSNjH0hNQsZ2/d4sGaACGboThVlIo5iM=</li>
</ul>
<hr/>
</body>
</html>
curl -L https://repo.maven.apache.org/maven2 shows me a long html document (as intended).
Any help would be greatly appreciated

Syndesis build error: Cannot access cluster for detecting mode

When trying to build syndesis I got this error that prevents me to build the images:
[INFO] --- fabric8-maven-plugin:3.5.38:build (build) # meta ---
[INFO] F8: Using OpenShift build with strategy S2I
[WARNING] F8: Cannot access cluster for detecting mode: Failure executing: GET at: https://192.168.42.178:8443/. Message: Unauthorized! Token may have expired! Please log-in again. Unauthorized.
[INFO] F8: Running generator spring-boot
[INFO] F8: spring-boot: Using Docker image fabric8/s2i-java:2.1 as base / builder
[WARNING] F8: Cannot access cluster for detecting mode: Failure executing: GET at: https://192.168.42.178:8443/. Message: Unauthorized! Token may have expired! Please log-in again. Unauthorized.
[ERROR] F8: Failed to execute the build [io.fabric8.kubernetes.client.DefaultKubernetesClient cannot be cast to
io.fabric8.openshift.client.OpenShiftClient]
...
[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:3.5.38:build (build) on project meta: Failed to execute the build: io.fabric8.kubernetes.client.DefaultKubernetesClient cannot be cast to io.fabric8.openshift.client.OpenShiftClient -> [Help 1]
...
Command used to build syndesis: syndesis build -i -f --clean-cache -c
This is because you are logged out from the "oc" command. If you try to use it you will get errors like this one:
$ oc get pods
error: the server doesn't have a resource type "pods"
To fix it, you have to login again:
$ oc login
Authentication required for https://192.168.42.178:8443 (openshift)
Username: developer
Password:
Login successful.
You have access to the following projects and can switch between them with 'oc project <projectname>':
myproject
* syndesis
Using project "syndesis".
If command "oc" is not recognized, you have to setup the environment first:
$ eval $(minishift oc-env)

Error while displaying javadocs in Jenkins

I am trying Jenkins with the help of the book - "Jenkins - The Definitive Guide"
I am getting error while displaying javadocs:
[ERROR] Plugin org.apache.maven.plugins:maven-install-plugin:2.5.2 or
one of its dependencies could not be resolved: Cannot access central
(https://repo.maven.apache.org/maven2) in offline mode and the
artifact org.apache.maven.plugins:maven-install-plugin:jar:2.5.2 has
not been downloaded from it before. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with
the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/PluginResolutionException Build step 'Invoke top-level Maven targets' marked build as failure
Both Java and Maven are installed on the machine where Jenkins is running.
I have the following info from the command line
$ mvn -version
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.10.0-32-generic", arch: "amd64", family: "unix"
Any hint to get around this issue?
--------------------- EDIT ---------------------------
After the last comment I made the changes as suggested and now I got the following errors:
[ERROR] Failed to execute goal on project gameoflife-web: Could not resolve dependencies for project com.wakaleo.gameoflife:gameoflife-
web:war:1.0-SNAPSHOT: Could not find artifact
com.wakaleo.gameoflife:gameoflife-core:jar:1.0-SNAPSHOT -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :gameoflife-web
Build step 'Invoke top-level Maven targets' marked build as failure
Recording test results
Publishing Javadoc
Finished: FAILURE

Google DataFlow sample TrafficStreamingMaxLaneFlow excution

I have succeeded to run the WordCount sample but failed to run TrafficStreamingMaxLaneFlow sample what arguments exactly I should use?.
My command line:
mvn exec:java -pl examples -Dexec.mainClass=com.google.cloud.dataflow.examples.TrafficStreamingMaxLaneFlow -Dexec.args="--project=sturdy-analyzer-658 --inputTopic=xxxInputTopic --dataset=xxxDataset --table=MIS --runner=BlockingDataflowPipelineRunner"
The result:
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1:java (default-cli) on project google-cloud-dataflow-java-examples-all: An exception occured while executing the Java class. null: InvocationTargetException: Failed to construct instance from factory method com.google.cloud.dataflow.sdk.runners.BlockingDataflowPipelineRunner#fromOptions: Missing required value: at least one of tempLocation or stagingLocation must be set. -> [Help 1]
Avi, add a stagingLocation arg to your invocation, along these lines:
--stagingLocation=gs://your-bucket/staging
Make sure this is a bucket in your project that you have write access to.

Resources