Issue with Building Java Application in Docker - java

I am at the Java Directory. And When I execute the build command:
docker build -t karthikjohnbabu/hello-world-java:0.0.2.RELEASE .
I get the below error message. Please help me???
failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:195e9c227ad891282e80602cac2372a3085ecf4ceefbb395558ffe0f7bb0b9aa: not found.
Complete details of error below:

Try adding the following arg to the command:
--platform=linux/amd64
or alternatively use the following command to set an env var:
export DOCKER_DEFAULT_PLATFORM=linux/amd64

The information you gave leaves room for guessing.
I believe the important part is no match for platform in manifest.
Thus I believe in your dockerfile you start FROM someimage, and this someimage is not available for the platform you are using (which could mean MacOS).

Related

When trying to build "./gradlew build" but it says build failed

I want to install COM port to connect my "Extended" controller (stabilization solution) but the software when plugged in, doesn't show any COM 3 ports. Found this solution https://github.com/NeuronRobotics/nrjavaserial
My steps: using the command git clone, after it is downloaded, I changed the directory to the folder it created.
$ cd nrjavaserial
After that, I tried to use this command.
$./gradlew build But it failed. Leaving this messagge in terminal :
What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache [in thread "Daemon worker"]
Any ideas? My guess is that java is not installed correctly or something is missing. Or support for this is not there.. Thank you in advance.
Using JAVA JDK jdk-18.0.2.1.jdk
M1 Macbook Air.

What causes this dependabot issue?

I am following this : https://bobbybouwmann.nl/blog/dependabot-on-gitlab, to attempt to get Dependabot working with gitlab. I get the following error?
Using docker image sha256:bc6c0ffef6650bcfbb0afd5a07b813b5ccf1d00ecddccadb85123c6ee57a7995 for docker with digest docker#sha256:63107bd6ce718f130bb2668704239467b74f034c446f9e9c4ae1ffa5ddf4e3dd ...
$ docker build -t "dependabot/dependabot-script" -f Dockerfile .
error during connect: Post "http://docker:2375/v1.24/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=dependabot%2Fdependabot-script&target=&ulimits=null&version=1": dial tcp: lookup docker on 172.31.0.2:53: no such host
So I checked, and the specified docker image does not exist: https://hub.docker.com/u/dependabot
but, if I use a different, publicly available image, I get this:
Executing "step_script" stage of the job script
00:03
Using docker image sha256:ed97757f85d791b7e0a967622f0d671b810d1ad45aef30d5314dcaef94e7c457 for sethjones/dependabot-script with digest sethjones/dependabot-script#sha256:209a0952bfeb845f67f2eeb9a647c25e058bbae1b9b0e343d7891884840f17e0 ...
/usr/local/lib/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require': cannot load such file -- dependabot/file_fetchers (LoadError)
from /usr/local/lib/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from ./generic-update-script.rb:4:in `<main>'
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1
I'd recommend that you check out the Dependabot GitLab repository. They provide a CI/CD template that is kept up-to-date, so instead of having to write your own jobs you can include their template using:
include:
- project: 'dependabot-gitlab/dependabot-standalone'
file: '.gitlab-ci.yml'
They also provide instructions on their page for how to configure it to automatically create MRs.

CERTIFICATE_VERIFY_FAILED when trying to build java-cef

I'm trying to build java-cef on ubuntu following instructions from https://bitbucket.org/chromiumembedded/java-cef/wiki/BranchesAndBuilding.
At cmake step
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
i get
-- Downloading clang-format from Google Storage...
Failed to fetch file gs://chromium-clang-format/942fc8b1789144b8071d3fc03ff0fcbe1cf81ac8 for tools/buildtools/linux64/clang-format. [Err: /home/x/Desktop/jcef/src/tools/buildtools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/boto/boto/pyami/config.py:71: UserWarning: Unable to load AWS_CREDENTIAL_FILE ()
warnings.warn('Unable to load AWS_CREDENTIAL_FILE (%s)' % full_path)
Failure: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727).
]
Terminal indicates that I'm using Python 2.7.15+.
How can i make it work? Many thanks.
In the folder where it has created the build jcef/src/tools/buildtools/download_from_google_storage.py change the version parameter of gsutil to a recent version, like 4.39. If you don't find specified file use a tool like find.

How to connect Opendaylight to Mininet?

I've been working in a simple Hello World project to learn the basics for Opendaylight (I was following this tutorial).
Now I want to connect this build of the controller to a network topology defined by Mininet but this is not working. I read that this may be due to I haven't installed odl-l2switch but when I type feature:list --installed the bundle doesn't appear and when I type feature:install odl-l2switch it doesn't appear neither.
Perhaps it is because the way I created the project:
mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeRepository=https://nexus.opendaylight.org/content/repositories/public/ -DarchetypeCatalog=remote -DarchetypeVersion=1.2.2-Boron-SR2
This is strange because I downloaded the Carbon release and I could connect this distribution with Mininet and it worked. Initially I was going to build the hello project in Carbon, the latest distribution, but it didn't work so I did the Hello-World in Boron release.
Can anyone help me?
This is my Github repository
Following this link, the command to generate an ODL app is :
mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller
-DarchetypeArtifactId=opendaylight-startup-archetype \
-DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/<Snapshot-Type>/ \
-DarchetypeCatalog=remote -DarchetypeVersion=<Archetype-Version>
where you have to replace as following the proper and :
For the current Master (Carbon) use Snapshot-Type=opendaylight.snapshot Archetype-Version=1.4.0-SNAPSHOT
For the Carbon snapshot use Snapshot-Type=opendaylight.release Archetype-Version=1.3.0-Carbon
For Boron "SR0" use Snapshot-Type=opendaylight.release Archetype-Version=1.2.0-Boron
For Boron SR1 use Snapshot-Type=opendaylight.release Archetype-Version=1.2.1-Boron-SR1
For Boron SR2 use Snapshot-Type=opendaylight.release Archetype-Version=1.2.2-Boron-SR2
For the Boron snapshot use Snapshot-Type=opendaylight.snapshot Archetype-Version=1.2.2-SNAPSHOT
The command you use uses 1.2.2-Boron-SR2 as , but as you use public, which is not the appropriate . Replace public with opendaylight.release, as the above link suggests.
When you run your ODL distribution , you have all the ODL projects which you can install it at anytime. To connect with mininet ,you have to install odl-l2switch-all feature.
In simple Hello project , you dont have l2switch feature to install. thats why you are not able to connect. Anyway you can install the l2switch feature by adding the l2switch dependency in Features/pom.xml and features.xml . You have to add the same odl version of l2switch.Be careful in this.
Please check feature:list | grep "l2switch" is available or not. If so, install it and launch the mininet !! You are done now !

DOCKER_HOST environment variable on windows

I'm running Docker 1.12.0 on a Windows 10 machine. I'm developing a Java program, using Maven 3.3.9 as a dependency manager. I have a maven docker plugin (https://github.com/fabric8io/docker-maven-plugin), which gives the following error on clean install.
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.15.16:build (docker-build-start) on project integration-test: Execution docker-build-start of goal io.fabric8:docker-maven-plugin:0.15.16:build failed: No <dockerHost> or <machine> given, no DOCKER_HOST environment variable, and no read/writable '/var/run/docker.sock' -> [Help 1]
When I run a clean install with the following configuration option in the POM file:
<dockerHost>tcp://0.0.0.0:2376</dockerHost>
the following result is shown.
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.15.16:build (docker-build-start) on project integration-test: Cannot create docker access object: Cannot extract API version from server https://0.0.0.0:2376: Connect to 0.0.0.0:2376 [/0.0.0.0] failed: Connection refused: connect -> [Help 1]
My question: is there an IP address I can use to tell this maven plugin where it can reach the daemon? Normal docker commands work perfectly fine. The plugin works without any problems on OS X.
After nearly a day of fruitless Googling I found this solution by myself. Trivial, but might still help others.
You need to enable the checkbox 'Expose daemon on...' under Settings -> General
On Windows 10 with Docker for Windows, the Docker Engine API is available in these two locations:
npipe:////./pipe/docker_engine
http://localhost:2375
I recommend trying with the localhost one.
Details here: https://docs.docker.com/docker-for-windows/faqs/#/how-do-i-connect-to-the-remote-docker-engine-api
It seems the user which is running Maven goals doesn't have access to docker.sock . The error message is telling which options are there to resolve the problem.
No <dockerHost> or <machine> given, no DOCKER_HOST environment
variable, and no read/writable '/var/run/docker.sock'
Last option is the easiest one because it requires a file permission and it doesn't need to create any docker machine or set a DOCKER_HOST, On Linux you can change read/write permission of docker.sock with the following:
sudo chmod 776 /var/run/docker.sock
On windows go through this article : Microsoft article
I had the same issue when I tried to build a project in a custom GitLab CI/CD runner, with another than root user defined in a custom build image. I fixed by setting the read/write permission for users to the docker-socket.
chmod o+rw /var/run/docker.sock
If you are using Window and Maven in eclipse to build your java project
but continue seeing that error, then you have to perform these steps:
Step1:
You need to enable the checkbox 'Expose daemon on...' under Settings -> General
As mentioned by #Adriaan Koster
If step1 does not solve the issue,then
Step2: Run your eclipse in administration mode.
Now it should work without issues.
If someone just wants to skip fabric8 docker-maven-plugin execution that prevents build to succeed with error
No 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
then this can be achieved with -Ddocker.skip=true according to https://dmp.fabric8.io/#global-configuration.
use docker-machine if you are using toolbox.
<machine>
<name>default</name>
<autoCreate>true</autoCreate>
<createOptions>
<driver>virtualbox</driver>
<virtualbox-cpu-count>2</virtualbox-cpu-count>
</createOptions>
</machine>

Categories

Resources