Tag: java

RabbitMq Spring Boot deploy docker

I’ve got a spring boot application with producer and receiver which uses the local rabbitmq to send and receive messages. I am trying to deploy both the app and rabbit on docker container and once deployed run the boot app. Once the app is started it has a producer which implements Spring CommandLineRunner meaning that […]

Error instantiating Spring Configuration class from properties file when running in Docker container

I’m getting a NumberFormatException when I run my webapp in a Tomcat 8 Docker container. The error occurs when Spring tries to instantiate the MongoConfig class, which is injecting @Values taken from a classpath properties file. The properties in the properties file are as follows: mongodb.host=mongodb mongodb.database=mydatabase mongodb.port=27017 mongodb.username=myusername mongodb.password=mypassword In the MongoConfig file it’s […]

Change Java “SecureRandom” in Dockerfile

I am using the docker image of tomcat with jre8, I have to change an option inside the java environment, it is possible to do it after the container is running, ssh to it and change securerandom.source=file:/dev/random to securerandom.source=file:/dev/urandom inside root@112ecdd0b71f:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security However, I want to do it automatically on before the container is starting up, […]

Docker with Java: path RUN javac

I have a problem with RUN javac in Dockerfile: Dockerfile: FROM jboss/wildfly RUN javac ../src/Hello.java RUN java -cp ../src Hello Hello.java public class Hello { public static void main(String[] args) { System.out.println(“Hello, World”); } } When I build Dockerfile, I have this error: javac: file not found: ../src/Hello.java My project “HelloWorld” has this structure: docker-dir […]

Can the docker image of sonarqube use env for configuring any settings?

I am trying to configure this image with LDAP. In the documentation, they argue you can configure for jdbc with : SONARQUBE_JDBC_USERNAME: sonar.jdbc.username* SONARQUBE_JDBC_PASSWORD: sonar.jdbc.password* SONARQUBE_JDBC_URL: sonar.jdbc.url* I wonder how I could do the same for LDAP. Is it possible to use any settings through their environment name ? Eg: SONAR_LOG_LEVEL=DEBUG Otherwise, there is inside […]

Docker How to connect to MongoDB from Web Service inside Container

Currently I want to setup a Linux Server with MongoDB and a WebServer which saves stuff inside this DB. I need them both to run inside Docker containers. My problem is that my WebServer doesnt seem to “see” the MongoDB from inside its container. What ive tried so far is: run MongoDB with docker run […]

Can I bundle the Oracle JDBC driver JAR in a Docker image?

I’m building Docker images based on the official Docker Tomcat images, where in addition to Tomcat, I add one of our web applications as a WAR file so it gets deployed when the container starts. Since the application requires access to a database, and the supported databases use different JDBC drivers and some additional configuration […]

How to get maven version in Jenkins pipeline

I am creating CI pipeline with Jenkins. Need to tag the docker images with the Maven version of the project, e.g. 0.0.1-SNAPSHOT. Although, maven version is exposed as POM_VERSION based on this Jenkins issue, it seems to apply only to the “Maven project”. I tried to use the variable in Pipeline’s Jenkins file as ${POM_VERSION} […]

Jacoco agent – no output

So here is the gist… I use docker-compose. My app is just a collection of REST services (spring boot w/ embedded tomcat) so basically I stick to testing endpoints. Whenever I wish to build project with tests (which are in a whole separate module) I use gradle and gradle docker-compose plugin. What happens is that […]

How to use Docker with Tomcat?

I´m trying to get more familiar with Docker because everyone talks about it and everyone loves it. I know how Docker works in general, but I don´t understand how to used it in practice. In my case, I have several web applications running on Tomcat. As far as I understand, it´s common to have one […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.