Tag: java

Detect if my app runs in Azure

I’m wondering if it is possible to detect if my Java app inside a Docker container is running in Azure. For AWS it is pretty simple, because AWS has the EC2 meta data service (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html). Has Azure something similar? Thanks and Regards, Sascha

RabbitMQ, docker, single queue, multiple consumers

We are using Docker, Spring and RabbitMq in our system. I’m new to AMQP and I’m trying to figure out how the exchanges, queues, bindings and connections work in our system. We have multiple dockerized applications. In short, when the applications start, they each start to listen to the same queue, and I don’t understand […]

passing correct ip via linked docker containers from nginx to jetty

I have two docker container running, one is a nginx that accepts http and https requests and passes them to the other one which is a jetty container. I have noticed an issue since I switched to docker. I can’t get the right request IP. The jetty application checks the request IP to ensure requests […]

Is it necessary to use Docker in Java?

As Docker is a very hot tech currently, but I just wonder if it is necessary for Java? I list my reasons below, and any feedback is welcomed: JVM just like a VM, which separate application from OS Maven, manage dependencies Spring Boot, support embed J2EE servelet containers like tomcat, all applications can be output […]

no fontmanager in java.library.path

The following code works just fine on my desktop: BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); Graphics g = image.getGraphics(); g.setFont(new Font(“SansSerif”, Font.BOLD, 18)); Graphics2D graphics = (Graphics2D) g; graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); graphics.drawString(s, 5, 20); However, when I run this code on my server (openjdk running on linux alpine within a Docker container), it fails with […]

JMeter – docker – java.net.connectexception

I am trying to do a distributed load testing using JMeter in AWS EC2 instances. I have 1 master and 2 slaves. All are ubuntu instances. They all have java and jmeter installed. I am able to successfully execute the test in the slaves w/o issues. (When i do no use docker) (JMeter uses RMI […]

Spring Properties from Docker Environment Variables

I’m trying to switch between config files inside a docker container using environment variables for my Spring 3.2.16 application. In my application context I have two profiles that load property files, the one I dev against (which works 100%) looks like this: <beans profile=”dev”> <context:property-placeholder location=”classpath*:META-INF/spring/dev.properties” /> </beans> When packaging the application in a container, […]

cucumber tests on docker won't fire at the integration-test phase

I’m having some problems getting my cucumber/phantomJs test to run against the docker container. My plan is to start the tomcat docker container at the maven pre-integration-test phase. Then at the integration-test phase i want to run the cucumber tests. For this i have disabled the surefire plugin to run test phase and included the […]

Cannot connect from MySQL Workbench to dockerized MySQL server

I’m trying to connect from the MySQL Workbench to my dockerized mysql server. I’m using Windows 10. Here is my Dockerfile: FROM ubuntu:latest # package updates & install mysql RUN apt-get update && apt-get install -y mysql-server RUN apt-get -y install supervisor ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf # bind sql script ADD musicdb.sql /tmp/musicdb.sql RUN sed -i […]

What is the best approach to configure Docker for a webapp?

I would like to configure a Docker container for running a Java application that uses Postgres and Jetty. What is the best approach to do this: Pull three separate containers from the Docker hub and somehow use them together. Create a Dockerfile from scratch with all configurations. Pull three images from the Docker hub and […]

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