Steps
Pull image and run with ports exposed:
docker run --name "nifi" -p 8443:8443 -d apache/nifi:latest
Fetch the generated username and password from the logs:
docker logs nifi | grep -A1 "Generated Username"
Generated Username [8f6d91f7-733e-40cf-b900-059ea9dccbf2]
Generated Password [v7KGiiRYLJL2+HzhKOqz1rbgiPOaWz0B]
Now we may enter the https://localhost:8443/nifi/login in our browser, accept the security exemption and login with the credentials from above, voila!
Installing additional connectors
I have found a nice summary on the following GitHub repository:
First of all, we’re setting the timezone and we’re downloading additional JDBC drivers:
docker exec -i -t nifi /bin/bash
nifi@443e05a7d5fa:/opt/nifi/nifi-current$ echo "java.arg.8=-Duser.timezone=Berlin/Europe" >> conf/bootstrap.conf
nifi@443e05a7d5fa:/opt/nifi/nifi-current$ cd lib
nifi@443e05a7d5fa:/opt/nifi/nifi-current/lib$ wget https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc8/21.1.0.0/ojdbc8-21.1.0.0.jar
nifi@443e05a7d5fa:/opt/nifi/nifi-current/lib$ wget https://jdbc.postgresql.org/download/postgresql-42.2.19.jar
Afterwards we need to stop the NiFi service - this will kick us out of the running container:
nifi@443e05a7d5fa:/opt/nifi/nifi-current/lib$ ../bin/nifi.sh stop
Java home: /usr/local/openjdk-8
NiFi home: /opt/nifi/nifi-current
Bootstrap Config File: /opt/nifi/nifi-current/conf/bootstrap.conf
2022-02-08 08:54:48,739 INFO [main] org.apache.nifi.bootstrap.Command Apache NiFi has accepted the Shutdown Command and is shutting down now
2022-02-08 08:54:48,748 INFO [main] org.apache.nifi.bootstrap.Command Waiting for Apache NiFi to finish shutting down...
2022-02-08 08:54:50,757 INFO [main] org.apache.nifi.bootstrap.Command Waiting for Apache NiFi to finish shutting down...
Now we must restart the Docker container
docker start nifi
We’re updating its restarting policy:
docker update --restart=always nifi