# Multicontainer: how to configure persistent storage

**URL:** <https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678>\
**Category:** Product support\
**Created:** [March 11, 2018, 6:02pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678 "2018-03-11T18:02:20Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![arturol76](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@arturol76](https://forums.balena.io/u/arturol76)\
**Post date:** [March 11, 2018, 6:02pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/1 "2018-03-11T18:02:20Z")

</div>

Hello,  
i’m using the new multicontainer feature.  
I’ve successfully built and deployed my microservices using the docker-compose below and everything is fine except for the persistent storage: in folder /mnt/data/resin-data i see only “resin-supervisor” but not my services’ folders.  
root@58bba1f:/mnt/data/resin-data# ls -la  
total 12  
drwxr-xr-x 3 root root 4096 Feb 28 06:08 .  
drwxr-xr-x 6 root root 4096 Feb 28 06:08 …  
drwxr-xr-x 2 root root 4096 Mar 11 17:48 resin-supervisor

![image](https://global.discourse-cdn.com/balena/original/1X/30b3ecac862806ee217aecf6245b958abe8f4cba.png)

Why?

Thank you in advance for your kind help

This is my docker-compose.yml:  
version: ‘2’  
services:  
mynodered:  
build: ./mynodered  
expose:  
- “1880”  
privileged: true  
restart: always  
network\_mode: host  
volumes:  
- /mnt/data/resin-data:/data  
mymosquitto:  
build: ./mymosquitto  
expose:  
- “1883”  
privileged: true  
restart: always  
network\_mode: host  
volumes:  
- ‘resin-data:/data’  
myinfluxdb:  
build: ./myinfluxdb  
expose:  
- “8086”  
privileged: true  
restart: always  
network\_mode: host  
volumes:  
- /mnt/data/resin-data:/data

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [March 11, 2018, 7:41pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/7 "2018-03-11T19:41:47Z")

</div>

Hi @arturol76, we don’t support volume bind-mount and you should use named volumes instead for persisted data.

Something like

```auto
    volumes:
      - dirname:/path/inside/container

```

See more in [our docs](https://docs.resin.io/reference/supervisor/docker-compose/) regarding what parts of the docker-compose syntax is supported.

---

<div class="post-metadata">

**Author:** ![zwalchuk](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/zwalchuk/32/842_2.png) [@zwalchuk](https://forums.balena.io/u/zwalchuk)\
**Post date:** [March 12, 2018, 2:48pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/8 "2018-03-12T14:48:06Z")

</div>

To expand on this @arturol76 , you’ll want to make sure you have the named volume defined at the top-level of the `docker-compose.yml`, in addition to the named volume link in the service, which it seems you have correctly defined in your mymosquitto service.

Something like:

```auto
version: '2'
volumes: 
    resin-data:
services:
    mynodered:
        build: ./mynodered
        volumes: 
            - 'resin-data:/data'

```

I’ll make sure our [multicontainer docs](https://docs.resin.io/learn/develop/multicontainer/#resin-io-settings) are updated to clarify this.

---

<div class="post-metadata">

**Author:** ![lv82](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/lv82/32/1044_2.png) [@lv82](https://forums.balena.io/u/lv82)\
**Post date:** [March 16, 2018, 2:25pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/9 "2018-03-16T14:25:04Z")

</div>

I also get:

```
[Error] Could not parse compose file
[Error] Bind mounts are not allowed
[Error] Not deploying release.

```

when building this `docker-compose.yml`:

```
version: '2'

services:
    telegraf:
        image: arm32v7/telegraf:1.5
        volumes:
            - ./etc/telegraf.conf:/etc/telegraf/telegraf.conf:ro

```

Any hint on how to migrate this short syntax to named volumes? I just need my local config file to end up in `/etc/telegraf`.

Alternatively, do you recommend building a custom container and copying the config file there? Something like:

```
version: '2'

services:
    telegraf:
        build: ./mytelegraf

```

and `./mytelegraf/Dockerfile` would look like:

```
FROM arm32v7/telegraf:1.5

COPY ./etc/telegraf.conf /etc/telegraf/telegraf.conf

```

But then I lose the ability to change the configuration on the fly…

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [March 16, 2018, 2:53pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/10 "2018-03-16T14:53:17Z")

</div>

Hey @lv82, the second way is they way I do it, you can have a look at my [mc-demo](https://github.com/shaunmulligan/mc-demo) project where I add a telegraf service that logs metrics to another backend influx instance.

---

<div class="post-metadata">

**Author:** ![lv82](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/lv82/32/1044_2.png) [@lv82](https://forums.balena.io/u/lv82)\
**Post date:** [March 16, 2018, 3:00pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/11 "2018-03-16T15:00:56Z")

</div>

Thanks @shaunmulligan. That sounds reasonable. Nice elaboration on the multicontainer example from the documentation.

On a side note, you might want to update the `git clone` line in your `README.md` from:

```
$ git clone git@github.com:resin-projects/simple-server-node.git

```

to:

```
$ git clone git@github.com:shaunmulligan/mc-demo.git
```

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [March 16, 2018, 3:06pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/12 "2018-03-16T15:06:30Z")

</div>

@lv82 good catch, I always just copy a template readme 😛 I am actually working on an expansion of this project that includes a services for remote logging (probably [loggly](https://www.loggly.com/product/) ), also wanna make use of the balena `HEALTHCHECK` functionality and generally make a nice “Starter” pack project that will get people going quickly with this type of stuff.

---

<div class="post-metadata">

**Author:** ![lv82](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/lv82/32/1044_2.png) [@lv82](https://forums.balena.io/u/lv82)\
**Post date:** [March 16, 2018, 3:25pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/13 "2018-03-16T15:25:25Z")

</div>

Great idea. Looking forward to it. Templates are very nice to enforce best practices and get everyone started faster.

---

<div class="post-metadata">

**Author:** ![arturol76](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@arturol76](https://forums.balena.io/u/arturol76)\
**Post date:** [March 16, 2018, 7:30pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/14 "2018-03-16T19:30:22Z")

</div>

thank you @zwalchuk for you reply.  
I did as you suggested:  
 ![image](https://global.discourse-cdn.com/balena/original/1X/a6627c08a89772b568d3e5c4b08f2726f0572055.png)

then i build it and push it to [resin.io](http://resin.io).  
This is what i can see in the “releases” page:  
 ![image](https://global.discourse-cdn.com/balena/original/1X/6f09fce64664cb2e13babc570d3d85e8b368ea81.png)

the mynodered service starts and works as expected. The point is that the /data folder used by nodered is still not persistent:  
 ![image](https://global.discourse-cdn.com/balena/original/1X/e2416638417d894fc0f57ca5f9546f108b106a29.png)

indeed, if i connect to the host os, i would expect to find a “mynodered” folder but i don’t see anything:  
 ![image](https://global.discourse-cdn.com/balena/original/1X/4333fc4c6a44d2d11ddfe4b4c536151916862e42.png)

What am i doing wrong?

---

<div class="post-metadata">

**Author:** ![zwalchuk](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/zwalchuk/32/842_2.png) [@zwalchuk](https://forums.balena.io/u/zwalchuk)\
**Post date:** [March 16, 2018, 9:11pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/22 "2018-03-16T21:11:14Z")

</div>

Hey @arturol76,  
We’ve actually changed the way we store persistent data, so now rather than keep it in `/mnt/data/resin-data/`, we create a named volume which can be accessed at `/mnt/data/docker/volumes/<APP ID>_resin-data/_data`. You can use `balena volume ls` to see all named volumes.

I’ll add this info to our docs ASAP.

---

<div class="post-metadata">

**Author:** ![jstnn](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jstnn/32/645_2.png) [@jstnn](https://forums.balena.io/u/jstnn)\
**Post date:** [March 17, 2018, 12:52pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/35 "2018-03-17T12:52:23Z")

</div>

i’m also having the same issue. any solution?

---

<div class="post-metadata">

**Author:** ![lv82](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/lv82/32/1044_2.png) [@lv82](https://forums.balena.io/u/lv82)\
**Post date:** [March 17, 2018, 8:55pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/36 "2018-03-17T20:55:47Z")

</div>

You mean the same issue as @arturol76? Have you tried looking in `/mnt/data/docker/volumes/<APP ID>_resin-data/_data`, as @zwalchuk recommends? Your data should be there.

---

<div class="post-metadata">

**Author:** ![arturol76](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@arturol76](https://forums.balena.io/u/arturol76)\
**Post date:** [March 17, 2018, 11:19pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/37 "2018-03-17T23:19:57Z")

</div>

Dears @lv82 and @zwalchuk  
I confirm that my services’ persistent data is now stored in folder /mnt/data/docker/volumes/\_resin-data/\_data

Thank you!

I will open another thread to ask whether makes sense to have persistent data on a external usb key and how to do that.

---

<div class="post-metadata">

**Author:** ![lv82](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/lv82/32/1044_2.png) [@lv82](https://forums.balena.io/u/lv82)\
**Post date:** [April 12, 2018, 7:48pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/38 "2018-04-12T19:48:59Z")

</div>

Hey @shaunmulligan, would you mind sharing why bind mounts are not supported? Any plans to support them in a near future?

---

<div class="post-metadata">

**Author:** ![lekkas](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/lekkas/32/78_2.png) [@lekkas](https://forums.balena.io/u/lekkas)\
**Post date:** [June 11, 2018, 8:18pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/40 "2018-06-11T20:18:39Z")

</div>

@lv82 I currently don’t have enough context to help you with why we don’t support them now, but with regards to future support of bind mounts, I’d suggest you subscribe to the issue at [https://github.com/resin-io/resin-supervisor/issues/643](https://github.com/resin-io/resin-supervisor/issues/643), so that you can get live updates of our progress there.

---

<div class="post-metadata">

**Author:** ![lv82](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/lv82/32/1044_2.png) [@lv82](https://forums.balena.io/u/lv82)\
**Post date:** [June 12, 2018, 7:32am UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/41 "2018-06-12T07:32:40Z")

</div>

@shaunmulligan I did just that one month ago when you created the issue. I have received yesterday’s notification. Thanks for the follow-up!

---

<div class="post-metadata">

**Author:** ![Zayn](https://avatars.discourse-cdn.com/v4/letter/z/a87d85/32.png) [@Zayn](https://forums.balena.io/u/Zayn)\
**Post date:** [October 21, 2018, 5:30pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/42 "2018-10-21T17:30:11Z")

</div>

I went to the following- /mnt/data/docker/volumes/\<APP ID\>\_resin-data/\_data  
What to do now? [https://vidmate.onl/vmate/](https://vidmate.onl/vmate/) [https://9apps.ooo/download/](https://9apps.ooo/download/)

---

<div class="post-metadata">

**Author:** ![samothx](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@samothx](https://forums.balena.io/u/samothx)\
**Post date:** [January 28, 2019, 10:56pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/53 "2019-01-28T22:56:08Z")

</div>

Hi, Thanks for reaching out to us.  
This thread is pretty long so I would like you to specify what you are trying to achieve , how you are doing it and what fails.  
Regards  
Thomas

---

<div class="post-metadata">

**Author:** ![smithclarkson01](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@smithclarkson01](https://forums.balena.io/u/smithclarkson01)\
**Post date:** [August 7, 2019, 6:02pm UTC](https://forums.balena.io/t/multicontainer-how-to-configure-persistent-storage/2678/59 "2019-08-07T18:02:46Z")

</div>

The path you mentioned is wrong brother, you need to change it to a new one and then try again.  
[9Apps](https://9appsapk.com) [Vidmate](https://vidmate.vin)
