Docker Community Forums

Share and learn in the Docker community.

Docker build Hang

(Walidmansia) #1

I am trying to build an image that
-> read a Java file
-> Compile It
-> Run It
-> Remove Class file

I dont know why the porcess is blocked when it is in the run phase "RUN java HelloWorld"
the container is still running and impossible for me to stop it, nothing to do to stop it is working
here are the docker file and the java file
the was in the same directory than the DockerFile

##Docker File
FROM java:openjdk-7-jdk


RUN mkdir -p /usr/share/maven
&& curl -fsSL$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz
| tar -xzC /usr/share/maven --strip-components=1
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

ENV MAVEN_HOME /usr/share/maven

RUN javac
RUN java HelloWorld
RUN rm HelloWorld.class

//Java Hello World

public class HelloWorld {

public static void main(String[] args) {
    // Prints "Hello, World" to the terminal window.
    System.out.println("Hello, World");


(Walidmansia) #2

it was because i ma running a VM under mac OS