Tag: java

Eureka on docker container : unknown host exception

I’m trying to start eureka server via spring boot on docker container and getting the following exception “unknownhostexception”. Now in the eureka config.properties file I’ve used hostname as localhost however the exception is showing that it somehow uses the hostname of the container rather than using the hostname which I’ve defined in eureka properties file. […]

java.net.SocketException when accessing docker host

I’m new to docker and need to connect from inside a running centos docker container to the host running the container using a java socket. When trying to connect a SocketException occurs: [root@743fedf46128 test]# java SocketTest 4444 0 Trying to connect using ip address Using remote ip Using remote port 4444 Using […]

Connection from Java UI container to couchDB container refuses

I have a question regarding Java and couchDB. My setup: – a Java UI with an interface to the DB – a couchDB inside a container, exposed on localhost:5984. Well. I have realized a connection between both in my local Windows machine, which worked perfectly. Now I packed both in containers, but I have a […]

How to import a CSV inside a Docker container with Java 8?

I want load data from a CSV file into my program on startup. On my local machine it works just fine, but when I try to Dockerize the spring boot application, my CSV file cannot be found. private final static String GIFTS_CSV = “gifts.csv”; public final static String PATH = “src/main/resources/static/”; public static Map<Integer, Gift> […]

Maven's target jar does not exist on Docker Hub

I have built a simple hello world rest service using spring boot. On my local machine (Ubuntu 14.04) when I run mvn package command, a runnable jar is getting created under target folder: equation-1.0-SNAPSHOT.jar. When I run this jar using java -jar equation-1.0-SNAPSHOT.jar I can see the hello world message via browser. Then I build […]

Executing docker command from a remote machine

I have a requirement where I need to execute some docker commands from a remote machine. I am using java ssh library to connect to the machine where I need to execute the docker commands, and then trying to execute the command. The actual docker command is: docker exec -it idaas_webtier_1 /bin/bash _tadm1=”${OTD_HOME}/bin/tadm” _tadm2=”–user=${OTD_ADMIN_USER} –password-file=${OTD_ADMIN_PWD} […]

Launching Docker demon from Java Service

Trying to launch a docker container in demon mode using shell script from java service deployed on Tomcat, on an ubunty based VM. I have a java based REST service which has been deployed on tomcat, on the same VM i have installed Docker. I have created a shell file to launch my docker container. […]

How to configure GWT debugging with docker?

I have my GWT project deploying in the docker containers. Tomcat application server container requires my_project.war, so every time I make a change in the code, I have to rebuild my project, replace old .war with the new one, rebuild container and run it again. This appears to be very ineffective and frustrating. My question […]

How to build Dockerfile with two jar files

I’m starting with Docker and I’m a little bit lost. I have my java experiment with two jar files, zip files with testing data and two configuration files. And I’m trying to run this exp on Docker. If I want to run this exp on my pc there are two phases. Phase 1: java -classpath […]

Why would I need to run docker privileged to access host log4j2.yaml

I’ve got a centos 7 image in a centos 7 host. My entrypoint uses -Dlog4j.configurationFile=file:/opt/foo/bar/log4j2.yaml I use a -v switch to share /home/fooser/log4j2.yaml:/opt/foo/bar/log4j2.yaml When I just use –cap-add SYS_ADMIN (I need samba access), log4j is unable to access it’s config file; however, if I use –privileged, everything works. I understand I must need an additional […]

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