Tag: java

Where to keep Dockerfile's in a project?

I am gaining knowledge about Docker and I have the following questions Where are Dockerfile’s kept in a project? Are they kept together with the source? Are they kept outside of the source? Do you have an own Git repository just for the Dockerfile? If the CI server should create a new image for each […]

Docker communication between two container with Java

I don’t find my answer on any post. I use a container with a project under PHP on a container which works fine. I want to link Java which is launch on another container. I use the “java:8″ image configure like this : engine: build: ./docker/engine/ volumes: – “.:/home/docker:rw” – “./docker/engine/php.ini:/usr/local/etc/php/conf.d/custom.ini:ro” links: – “db:db” – […]

How to create docker image for local application taking file and value parameters

I have a java application (jar file) that I want to be able to run from a docker image. I have created a Dockerfile to create an image using centos as base and install java as such: Dockerfile FROM centos RUN yum install -y java-1.7.0-openjdk I ran docker build -t me/java7 after to obtain the […]

Consul and Spring Boot services in Docker – not deregistering

So we have Java microservices written with Spring-Boot, using Consul for service discovery and config management and running in Docker containers. All of it is working, but when a container dies or a service restarts the old service-id never goes away in Consul and the service forever after shows as “Failing” in the Consul UI, […]

Docker – Get bound port inside java application

I am creating a instance of my image like docker run -P webmodule-xy The Dockerfile for the webmodule exposes a port (e.g. 8080). My goal now is to obtain the mapped / assigned port number which is accessible from the outside via Java. Is there a environment variable or something like that? Usecase: The webmodule-xy […]

How to install a specific version of Java 8 using Dockerfile

I am trying to build a Docker Container (using a Dockerfile) with a specific version of Java 8 on it. A lot of the examples target the latest release. RUN add-apt-repository -y ppa:webupd8team/java RUN apt-get update -y RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections RUN apt-get install -y oracle-java8-installer I have a need […]

How to reduce my java/gradle docker image size?

I have a Docker file like the following: FROM openjdk:8 ADD . /usr/share/app-name-tmp WORKDIR /usr/share/app-name-tmp RUN ./gradlew build \ mv ./build/libs/app-name*.jar /usr/share/app-name/app-name.jar WORKDIR /usr/share/app-name RUN rm -rf /usr/share/app-name-tmp EXPOSE 8080 RUN chmod +x ./docker-entry.sh ENTRYPOINT [ “./docker-entry.sh” ] The problem is that the final image size is 1.1GB, I know it happens because gradle downloads […]

Connect to HBase running in Docker

I cannot connect to HBase running in Docker on Windows (banno/hbase-standalone image). However, I can connect to locally installed HBase. banno/hbase-standalone image is run using: docker run -d -p 2181:2181 -p 60000:60000 -p 60010:60010 -p 60020:60020 -p 60030:60030 banno/hbase-standalone I also set up the port forwarding on the boot2docker-vm (which is required when running on […]

JVM Memory Allocation In Docker (LXC) Container

We’ve dockerized a JVM (Scala) application, Java 1.7, and are trying to decide how to allocate memory. We have a single application running in the docker container. If the docker container is allocated 4GB of RAM, should we allocate 4GB (or maybe a little less just to be safe) to the JVM? As I understand […]

How to debug an application running in Docker with IntelliJ?

I have a Jetty application running in docker. I would like to debug this application using my local IntelliJ. I am on v 14.1, so I have installed the Docker Integration plugin. Under Clouds, I am using the default values that showed up when I click on the ‘+’. IntelliJ docs say this should be […]

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