You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Bengt Haard (Jira)" <ji...@apache.org> on 2021/10/13 14:41:00 UTC

[jira] [Commented] (NIFI-5799) Unable to extend docker image with custom configuration

    [ https://issues.apache.org/jira/browse/NIFI-5799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17428270#comment-17428270 ] 

Bengt Haard commented on NIFI-5799:
-----------------------------------

I have the same problem. Besides this, I would also like to have the possibility to move all the data directories (repositories,
logs, conf and state) to a customized location, e.g. /var/lib/nifi/<version> instead. A setup like this is recommended
in the Nifi admin guide under the heading "Upgrade Recommendations", but is not possible to implement as long as volumes are defined in the Dockerfile.

The simplest solution is to do as proposed in this issue, remove the volumes section. To get data persistence volumes should instead be defined when starting the container, e.g.

docker run --name nifi \
-p 8443:8443 \
-d \
-v logs_vol:/opt/nifi/nifi_current/logs \
-v conf_vol:/opt/nifi/nifi_current/conf \
-v content_vol:/opt/nifi/nifi_current/content_repository \
-v database_vol:/opt/nifi/nifi_current/database_repository \
-v flowfile_vol:/opt/nifi/nifi_current/flowfile_repository \
-v provenance_vol:/opt/nifi/nifi_current/provenance_repository \
-v state_vol:/opt/nifi/nifi_current/state \
 apache/nifi:1.14.0

 

> Unable to extend docker image with custom configuration
> -------------------------------------------------------
>
>                 Key: NIFI-5799
>                 URL: https://issues.apache.org/jira/browse/NIFI-5799
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Docker
>    Affects Versions: 1.8.0
>            Reporter: Noel Winstanley
>            Priority: Major
>
> I build a custom docker image for my product, based on the stock docker nifi image.
> My Dockerfile installs a flow.xml.gz, and then uses sed to adjust some properties in conf/bootstrap.conf and conf/nifi.properties. This worked well with previous versions of Nifi
> https://issues.apache.org/jira/browse/NIFI-5438 (introduced in Nifi 1.8.0) added a VOLUME command to the docker file that covers ${NIFI_HOME}/conf .
> I am still able to copy a new flow.xml.gz into the conf directory, BUT am unable to edit files already in the conf dir (using sed or otherwise).
> This surprising behaviour is backed up by the dockerfile docs https://docs.docker.com/engine/reference/builder/#volume  - "
> *Changing the volume from within the Dockerfile*: If any build steps change the data within the volume after it has been declared, those changes will be discarded. "
> The properties I wish to override (e.g. nifi.bored.yield.duration) aren't supported as environment variables, so I can't pass them in from a compose file or similar.
> Having a VOLUME command over a configuration directory really hampers the extensibility of the docker image - could it be removed?
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)