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

ASF GitHub Bot commented on NIFI-5438:
--------------------------------------

Github user pepov commented on the issue:

    https://github.com/apache/nifi/pull/2905
  
    @MikeThomsen sure! If you run the integrations tests you will have the 
following images available:
    ```
    docker images | grep nifi | grep 1.8.0-SNAPSHOT
    apache/nifi                                              
1.8.0-SNAPSHOT-dockerhub     a670a54ee676        30 hours ago        1.74GB
    apache/nifi                                              
1.8.0-SNAPSHOT-dockermaven   0f1e3ae32879        30 hours ago        3GB
    ```
    Now you run one of those, for example:
    ```
    docker run -d --name nifi apache/nifi:1.8.0-SNAPSHOT-dockermaven
    ```
    You can inspect the volumes it created using the following command:
    ```
    docker inspect nifi | jq '.[].Mounts | map([.Source, .Destination])'
    [
      [
        
"/var/lib/docker/volumes/139a9e99e6542165f061923168944ca184a6340b330aec3aa20efe1f70fd22a3/_data",
        "/opt/nifi/nifi-1.8.0-SNAPSHOT/conf"
      ],
    ...
    ```
    You won't be able to access that directory from your host on a Mac for 
example, but you can mount it and examine it using another docker container. 
Lets mount the whole `/var/lib/docker` folder and check one of the volumes:
    ```
    docker run -ti --rm -v /var/lib/docker:/var/lib/docker debian bash -c "ls 
-al 
/var/lib/docker/volumes/139a9e99e6542165f061923168944ca184a6340b330aec3aa20efe1f70fd22a3/_data"
    total 88
    drwxr-xr-x 3 1000 1000  4096 Jul 19 15:20 .
    drwxr-xr-x 3 root root  4096 Jul 19 15:19 ..
    drwxr-xr-x 2 1000 1000  4096 Jul 19 15:20 archive
    -rw-rw-r-- 1 1000 1000 20135 Jun  1 14:21 authorizers.xml
    -rw-rw-r-- 1 1000 1000  2326 Jun  1 14:21 
bootstrap-notification-services.xml
    -rw-rw-r-- 1 1000 1000  3509 Jun  1 14:21 bootstrap.conf
    -rw-r--r-- 1 1000 1000   271 Jul 19 15:20 flow.xml.gz
    -rw-rw-r-- 1 1000 1000  8095 Jun  1 14:21 logback.xml
    -rw-rw-r-- 1 1000 1000  6449 Jun  1 14:21 login-identity-providers.xml
    -rw-rw-r-- 1 1000 1000 11114 Jul 19 15:19 nifi.properties
    -rw-rw-r-- 1 1000 1000  8669 Jun  1 14:21 state-management.xml
    -rw-rw-r-- 1 1000 1000  1437 Jun  1 14:21 zookeeper.properties
    ```
    You can combine this with bind mounting a volume from your host system and 
you are then ready to make backups from a running or even from an already 
removed container for example.
    
    After removing the nifi container forcefully:
    ```
    docker rm -f nifi
    ```
    You will still be able to list the volumes and mount it to an arbitrary 
container as in the previous example:
    ```
    docker volume list
    DRIVER              VOLUME NAME
    local               
11f81374f20c3b80234f5662898ac93eb7dcea9210c9c84e70782025351d9915
    local               
139a9e99e6542165f061923168944ca184a6340b330aec3aa20efe1f70fd22a3
    local               
182188a75419e8ed029b910ac5ca73675250675eac033056e11b0e1f9b7a5b84
    local               
3967c839cc69c373adc78efd3d1ad1d626ad068b2c7e82c09902167f243edcd1
    local               
8b021167e1d5b4b58d708b9c08019a6dd5a890d27bc72535085335cda5b28fc7
    local               
a80d1be309ddde9d76aa405642ca036df477e3bd0670e07d5de37f5521a92bd7
    local               
a95d23b02768fe8858937da94b41342052722589a9cf0a609f023c147eb1ee66
    local               
f63966beb26225b0fe146257c0d649a9a04d94b4fc2daedb192e63ca4cf0a28f
    ```


> Declare volumes for the NiFi docker container for persistence by default
> ------------------------------------------------------------------------
>
>                 Key: NIFI-5438
>                 URL: https://issues.apache.org/jira/browse/NIFI-5438
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Docker
>    Affects Versions: 1.8.0
>            Reporter: Peter Wilcsinszky
>            Assignee: Peter Wilcsinszky
>            Priority: Major
>             Fix For: 1.8.0
>
>
> Volume declarations are missing from the NiFi Dockerfiles.
> *Without* that all data get lost after removing the container when there was 
> no explicit volume declarations defined.
> *With* volume declarations all the data on the declared volumes will get 
> persisted on the host without any explicit volume declarations required by 
> the user.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to