Tag: java

How to create a Dockerfile with Maven on a Windows box and then sent to a remote Linux server for building an image and then ran?

I have a Java project building with Maven. I want to dynamically create a Dockerfile when it builds. My end goal is to create an executable Jar and Dockerfile, send them both to a server where the Dockerfile is used to build the image that will execute the Jar and then run the container. This […]

How do you share privileged information with a docker container deployed as a worker on elastic beanstalk?

I have a file containing privileged information (private/public keys, etc) which I don’t want to commit to my github repository but is required to run my data processing app. I’m using elastic beanstalk to deploy this application as a docker container to an EC2 instance. Trying to stay away from hacking something together with environment […]

Running JUnit Tests in parallel with Docker

I’m trying to run JUnit Test parallel with Docker. I use a database instance which stored on Amazon AWS RDS. I should run the database instance in a seperate Docker Image. The plan is to run every JUnit test in it’s own Docker instance. Currently I have my jar-File with all my Unit-Tests, including Maven […]

How to skip a gradle task under some cases, which introduced by the bmuschko/gradle-docker-plugin?

I use the gradle plugin bmuschko/gradle-docker-plugin to integrate docker with gradle. I create some tasks in the build.gradle file: task copyJar(type: Copy) { dependsOn build from project.file(“$project.buildDir/libs/” << jarName) into project.file(“$project.buildDir/docker”) } task createDockerfile(type: Dockerfile) { dependsOn copyJar // Generate Dockerfile } task buildDockerImage(type: DockerBuildImage) { dependsOn createDockerfile inputDir = createDockerfile.destFile.parentFile tag = ‘example.com/’ << […]

VisualVM unable to connect remote tomcat in docker with RMI

I am runing tomcat in a docker container on a remote machine. Now I want to use VisualVM to connect. My docker start command: docker run -d –name tomcat -p 26000:8080 -p 9090:9090 -p 9091:9091 -v /data/docker/tomcat/webapps:/data/tomcat/webapps -v /data/docker/tomcat/logs:/data/tomcat/logs -e CATALINA_OPTS=”-Xms2048M -Xmx2048M -XX:MaxPermSize=256M -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=″ my.private.hub/tomcat:latest And the catalina.log: 13-Mar-2015 10:29:56.615 INFO […]

Java Maven Project Docker Integration Tests

We have a big multi module maven project, wich uses cargo to start a tomcat with some wars, a plugin to insert sql data in a postgres database and then using cucumber we run the integration test suit. I was reading a lot about Docker, and I could play around with it. So here my […]

Docker java:7 image apt-get update cyclic dependencies

I am using the official java:7 docker image. When I run apt-get update on it, it throws an error: E: The method driver /usr/lib/apt/methods/https could not be found. N: Is the package apt-transport-https installed? So when I run: apt-get install apt-transport-https It says unable to locate the package Reading package lists… Done Building dependency tree […]

(spotify) Maven docker builder for Java

I’m trying to build docker image for Java using (spotify) Docker Maven Plugin. But while running mvn package docker:build on my project, I’m constantly getting the following error: Failed to execute goal com.spotify:docker-maven-plugin:0.2.6:build (default-cli) on project gs-spring-boot-docker: Exception caught: Get https://index.docker.io/v1/repositories/library/java/images: dial tcp: lookup index.docker.io on no answer from server -> [Help 1]

JAVA 6 Docker client

I’m looking for a way to orchestrate Docker containers using JAVA 6. So I have the Docker images ready but I want to be able to start and stop and interact with them but I am limited to JAVA 6. All the JAVA client libraries I’ve found so far instead of JAVA 7, but I […]

How to check the status of an image using docker-java library

I am trying to check if the image is running or not using the docker-Java library(https://github.com/docker-java/docker-java). I can get the list of all running images using the following List<Container> containers = dockerClient.listContainersCmd().exec(); Is there a way to check the status of the image if its running or not using the docker-java library?

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