Reputation: 21
So, I want, very basically, to be able to spin up a container which runs Nifi, with a template I already have. I'm very new to containers, and fairly new to Nifi. I think I know how to spin up a Nifi container, but not how to make it so that it will automatically run my template every time.
Upvotes: 2
Views: 4723
Reputation: 14194
You can use the apache/nifi
Docker container found here as a starting point, and use a Docker RUN
/COPY
command to inject your desired flow. There are three ways to load an existing flow into a NiFi instance.
$NIFI_HOME/conf/flow.xml.gz
, and overwrite the flow.xml.gz
file in the "destination" NiFi's conf
directory. This does not require the destination NiFi instance to be running, but it must occur before the destination NiFi starts. I would recommend Option 2, as you should have the desired flow as you want it. Simply use COPY /src/flow.xml.gz /destination/flow.xml.gz
in your Dockerfile.
If you literally want it to "run my template every time", you probably want to ensure that the processors are all in enabled state (showing a "Play" icon) when you copy/save off the flow.xml.gz
file, and that in your nifi.properties
, nifi.flowcontroller.autoResumeState=true
.
Upvotes: 4