I'm a new to Docker. Tried to start docker container with simple java code.
I saw the printing Hello-World
, that means that my code is executed, but the container always exits.
This is my Dockerfile:
FROM nicb/alpine-openjdk8-jre
COPY HelloDockerTest.jar /
CMD java -jar HelloDockerTest.jar
FROM nicb/alpine-openjdk8-jre
- this is image from remote repository
The steps that I do are:
1. docker build -t testtt .
2. docker run -i testtt
3. docker start 2520e85b333a
In the last step I see the printing "Hello World" but when I do docker ps
I see nothing.
What did I do wrong?