Apache Nifi’s latest release, 1.2.0, brought with it an official docker image on the docker hub. So let’s get started.

Pull the docker image, note after a latest tag is created you can drop the release version.

docker pull apache/nifi:1.2.0

Next, start the image as is to see it run. The -p 8080:8080 exposes the remote nifi port locally.

docker run -p 8080:8080 apache/nifi:1.2.0

Last, we can use docker volume to add a custom nar. Split the commands in two so the volume or nar is created before starting the image. Doing it this way will allow you to use the docker cp command to replace the nifi.properties file too.

docker create --name nifi \
   -v /FULL_PATH/sample.nar:/opt/nifi/nifi-1.2.0/lib/sample.nar \  
   apache/nifi:1.2.0
docker start nifi

Visit localhost:8080 to view nifi.