Reputation: 756
I'm new to apache/nifi and run it with :
docker run --name nifi -p 8081:8080 -d apache/nifi:latest
and then dragged some processors. And then I tried to save them as new image using:
docker commit [container ID] apache/nifi:latest
But it does not save the changes when I run the new committed image. Please advice me if any mistake. Thanks in advance.
Update
At first I launched nifi with:
docker run --name nifi -p 8081:8080 -d apache/nifi:latest
This is the group I added on the web UI:
I want to save the container so I committed with following command:
docker commit 1e7 apache/nifi:latest2
we can see 2 nifi images here:
Then I run:
docker run --name newnifi -p 8080:8080 -d apache/nifi:latest2
to chekc if the changes are saved in the new image. But the Web UI is empty and the group is not there.
Upvotes: 2
Views: 1443
Reputation: 1193
This is coming from discussion on official slack channel for Apache Nifi.
Looks like the flow definitions are stored in the flow.xml.gz
in the /conf
directory.
The apache/nifi
docker image defines this folder as volume.
Directories defined as volumes are not committed to images created from existing containers. https://docs.docker.com/engine/reference/commandline/commit/#extended-description.
That's why the processors and groups are not showing up in the new image.
These are the alternatives to consider:
flow.xml.gz
file to your new container.NiFi Registry
to store your flow definition, then import from there.Upvotes: 2
Reputation: 806
docker commit
is for creating a new image from a container’s changes, meaning when you update or add new config or install new software, thus creating a new template images. Simply issue the docker stop NAME_OF_CONTAINER
and when you would like to restart it docker start NAME_OF_CONTAINER
Upvotes: 1