Tag: java

Permission required to run java under non-root user in Google Container Engine

I don’t have problem to run Java with root user. /usr/java/jre1.8.0_101/bin/java -jar /app/ts.jar Because the application is deployed into docker container, so I need run it with non-root user. First I create a user in the docker container useradd –user-group -m –shell /bin/false ts2_app; chown -R ts2_app:ts2_app /app; chown -R ts2_app:ts2_app /usr/java/jre1.8.0_101; chmod -R +r […]

Javac compiler not recognizing wildcard?

I set up a folder containing a test java file that only contains the word “test”. I want docker to compile it. To run it, I call $ docker run -it -v ~/my/path/testpayload:/payload -w /payload test_docker javac -cp /usr/share/java/*:. *.java However, I get the following error javac: file not found: *.java Usage: javac <options> <source […]

Issue connecting elasticsearch cluster (i.e. non dockerized) from elasticsearch client running in docker container

I am connecting from elasticsearch client running in docker container to elasticsearch cluster (i.e. non dockerized). I am able to do this by having settings in the client as: Settings settings = ImmutableSettings.settingsBuilder() .put(“node.name”, “HelloESClient”) .put(“discovery.zen.ping.multicast.enabled”, false) .put(“discovery.zen.ping.unicast.hosts”, “”) .put(“transport.publish_port”, “9300”) .put(“transport.publish_host”, “”); where is the host ip: port exposed for elasticsearch cluster to […]

Can I connect VisualVM to remote Java process in Docker without exposing the RMI port as itself?

I’ve been able to connect VisualVM to my Java process, running in a Docker container, doing something as docker run \ –rm \ –entrypoint=java \ -p 9010:9010 \ my-user/my-image \ -Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.port=9010 \ -Dcom.sun.management.jmxremote.rmi.port=9010 \ -Dcom.sun.management.jmxremote.local.only=false \ -Dcom.sun.management.jmxremote.authenticate=false \ -Dcom.sun.management.jmxremote.ssl=false \ -Djava.rmi.server.hostname=’′ \ -jar /my-app-1.0-SNAPSHOT.jar I have a couple problems with this solution, though: […]

Apache-drill is not running inside docker container

I was trying move our web application into a docker container. I created a custom docker image for this purpose. I have installed Java-1.8, apache-drill-1.6, zookeeper-3.4.8 & apache-karaf-4.0.4 within the docker container. [ I have already came through some articles related to running multiple processes within a docker container . But unfortunately, I need everything […]

Docker container cannot send log to docker ELK stack

I deployed ELK stack and another separated docker container of spring boot app. In the java app, I use the LogstashSocketAppender to send logs to logstash. If the java app running standalone without docker, it works fine. But when it’s running as a docker container, the logstash cannot receive logs. Can anyone help me figure […]

Docker container start error

canerapp: image: tomcat ports: – “8000:8000” this is my compose.yml. when i run to up caner@vegan:~/IdeaProjects/homework$ docker-compose up Creating homework_canerapp_1 Attaching to homework_canerapp_1 canerapp_1 | 31-Aug-2016 07:31:53.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.36 canerapp_1 | 31-Aug-2016 07:31:53.363 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jun 9 2016 13:55:50 UTC canerapp_1 | 31-Aug-2016 07:31:53.364 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log […]

Dockered Play app gives IllegalAccessError: tried to access method com.google.common.collect.MapMaker.makeComputingMap

I recently posted a question about failed downloads in running a Docker play-java application. It has since been resolved by adding the particular missing dependency sisu-guice-3.1.0 in the local maven repo and mounting .m2 to the docker container. Now the application runs very well and properly starts netty. However, problem comes when I launch the […]

How to run jar file using docker file in docker container

I write the docker file for run the jar file and it does not create the log file for see the console below is my docker file From ubuntu RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y software-properties-common && \ add-apt-repository ppa:webupd8team/java -y && \ apt-get update && \ echo […]

Update Docker image and container from Jenkins

I am quite new to Jenkins and Docker so I am stuck with trying to make them work together. What I want is to do next steps: Build my project war-file on Jenkins (Done) Update Docker image and container. In my case I want to stop running container (Tomcat on it), change war-file to the […]

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