0

I wan´t to play around with Dockerfiles a bit. So I tried running Apache Nifi in Docker. I know that there is already a container available, this is for training purpose. I configured my Dockerfile as followed:

FROM openjdk:8-jre-alpine
COPY . /app
WORKDIR /app
EXPOSE 8080
CMD ["sh","nifi-1.9.0/bin/nifi.sh","start"]

Now this seems to work, but when I try to run the container with:

docker build --tag nifid .
docker run --name nifi-app -p 8080:8080 nifid

It seems to run but the port is neither exposed, nor can I reach the App via localhost:8080. Any suggestions on how to proceed? This is what docker ps --all shows me

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                    PORTS               NAMES
ccf75612d5ac        nifid               "sh nifi-1.9.0/bin/n…"   20 hours ago        Exited (0) 20 hours ago                       nifi-app

I realize that the app was excited now. Anything wrong i the Dockerfile?

EDIT: The docker logs [Container ID] spitted following:

Java home: /usr/lib/jvm/java-1.8-openjdk/jre
NiFi home: /app/nifi-1.9.0

Bootstrap Config File: /app/nifi-1.9.0/conf/bootstrap.conf

EDIT: Found a nice "documentation" https://hub.docker.com/r/apache/nifi/dockerfile

A bit to indepth but it should to the job

Dennis Jaheruddin
  • 21,208
  • 8
  • 66
  • 122
Derek Haynes
  • 125
  • 1
  • 2
  • 13

2 Answers2

0

Well it seems like your container has stoppen (status Exited)

docker ps (shows running containers)
docker ps -a (shows all containers, even stopped)

Try

docker logs <container-id> 

To see the output from the container. It will properly tell you why the container stopped.

F.Madsen
  • 702
  • 4
  • 6
0

Container need a pid 0 process to run forever until killed or errors.

For example, enter image description here

Please refer to https://stackoverflow.com/a/45450456/1926952 to keep a container running

paco alcacer
  • 381
  • 2
  • 13