1

Hi I have a Nifi docker container stopped and I want to update a property file.
Whenever I update a field, when I run docker-compose start it doesn't update the property file.
How can this be possible?
here is my docker compose:

version: "3.3"
services:
  nifi:
    image: apache/nifi
    volumes:
      - /home/ubuntu/nifi/conf:/opt/nifi/nifi-current/conf
    ports:
      - "8080:8080"

Thanks

3nomis
  • 1,175
  • 1
  • 9
  • 30
  • normally you do not need also to stop/start to update the file that should be done on the fly.... – LinPy Sep 10 '19 at 12:35
  • 1
    try to cat /home/ubuntu/nifi/conf and docker exec nifi cat /opt/nifi/nifi-current/conf , if they're both showing the same un-updated data, it could be that your application writes to the config file when its started – Bouzid Zitouni Sep 10 '19 at 12:36
  • It changes in both on a running container. However I do need restart it because Nifi reads this properties on start and the mod disappears. How could I fix the issue? – 3nomis Sep 10 '19 at 12:49

1 Answers1

2

We had this issue a while back as well. I believe using volumes essentially creates a symlink, and when the container starts up it overwrites anything in that folder.

Have you considered creating a multistage build? That was our solution:

Dockerfile:

FROM apache/nifi:1.9.2
ADD /path/to/your-props.properties /opt/nifi/nifi-current/conf

We then put the resulting image in our compose

Joseph Thweatt
  • 316
  • 2
  • 14