# \[Solved\] Aggregating logs using Logspout - \[Error\] Bind mounts are not allowed

**URL:** <https://forums.balena.io/t/solved-aggregating-logs-using-logspout-error-bind-mounts-are-not-allowed/16752>\
**Category:** balenaOS\
**Tags:** raspberrypi3, docker\
**Created:** [June 20, 2019, 3:03pm UTC](https://forums.balena.io/t/solved-aggregating-logs-using-logspout-error-bind-mounts-are-not-allowed/16752 "2019-06-20T15:03:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craigson](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@Craigson](https://forums.balena.io/u/Craigson)\
**Post date:** [June 20, 2019, 3:03pm UTC](https://forums.balena.io/t/solved-aggregating-logs-using-logspout-error-bind-mounts-are-not-allowed/16752/1 "2019-06-20T15:03:56Z")

</div>

I have several containers running on my Raspberry Pi 3 that I’d like to aggregate the logs for and stream them using Papertrail. It seems that the generally accepted method to do this is have a dedicated logging container that aggregates the other containers log events. This can be done in docker using some version of this in the docker-compose:

```auto
logspout:
    image: gliderlabs/logspout:latest
    command: 'syslog://logsN.papertrailapp.com:XXXXX '
    volumes:
      - '/var/run/docker.sock:/tmp/docker.sock'

```

After exploring the Host on Balena OS, and a few forum posts, it seems that `/var/run/balena.sock` replaces `/var/run/docker.sock`. Given that bind mounts are not supported by Balena, I’m at a bit of a loss as to what to do. This forum post ( [Where is docker.sock?](https://forums.balena.io/t/where-is-docker-sock/8122) ) is the closest I’ve come to finding a similar issue, however because I’m building directly from an image, I don’t have the option of using `CP` inside the docker file.

How do I connected to the Docker (Balena) socket if bind mounts aren’t supported. Otherwise, is there a generally accepted way to aggregate logs from multiple containers?

---

<div class="post-metadata">

**Author:** ![chrisys](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chrisys/32/1731_2.png) [@chrisys](https://forums.balena.io/u/chrisys)\
**Post date:** [June 20, 2019, 3:34pm UTC](https://forums.balena.io/t/solved-aggregating-logs-using-logspout-error-bind-mounts-are-not-allowed/16752/4 "2019-06-20T15:34:29Z")

</div>

Hey @Craigson, it looks like what you’re looking for in this case is the label `io.balena.features.balena-socket` which when added to your docker-compose file, will bind mount the container engine socket into the container. You’d do:

```auto
logspout:
    image: gliderlabs/logspout:latest
    command: 'syslog://logsN.papertrailapp.com:XXXXX '
    labels:
        io.balena.features.balena-socket: '1'

```

Take a look here for more information: [https://www.balena.io/docs/learn/develop/multicontainer/#labels](https://www.balena.io/docs/learn/develop/multicontainer/#labels)

---

<div class="post-metadata">

**Author:** ![Craigson](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@Craigson](https://forums.balena.io/u/Craigson)\
**Post date:** [June 20, 2019, 4:20pm UTC](https://forums.balena.io/t/solved-aggregating-logs-using-logspout-error-bind-mounts-are-not-allowed/16752/6 "2019-06-20T16:20:01Z")

</div>

Thanks @chrisys, that seemed to do the trick, the container is now running but doesn’t initialize properly:

```auto
20.06.19 12:15:48 (-0400) logspout standard_init_linux.go:207: exec user process caused "exec format error"

```

I’m sure this is related to the actual Logspout image, but is this something perhaps a generic error encountered on the RPi3 running Balena OS before? My first inclination is that the image has binaries that aren’t compiled for ARM.

---

<div class="post-metadata">

**Author:** ![chrisys](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chrisys/32/1731_2.png) [@chrisys](https://forums.balena.io/u/chrisys)\
**Post date:** [June 20, 2019, 4:25pm UTC](https://forums.balena.io/t/solved-aggregating-logs-using-logspout-error-bind-mounts-are-not-allowed/16752/7 "2019-06-20T16:25:32Z")

</div>

Yup that would be my inclination too - I suspect there’s something that isn’t compiled for ARM.

---

<div class="post-metadata">

**Author:** ![Craigson](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@Craigson](https://forums.balena.io/u/Craigson)\
**Post date:** [June 20, 2019, 4:27pm UTC](https://forums.balena.io/t/solved-aggregating-logs-using-logspout-error-bind-mounts-are-not-allowed/16752/8 "2019-06-20T16:27:22Z")

</div>

It’s never easy 😅

What’s the community’s general approach to logging in multicontainer setups? Any resources you can point to? I’m not married to the logspout+papertrail solution.

---

<div class="post-metadata">

**Author:** ![Craigson](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@Craigson](https://forums.balena.io/u/Craigson)\
**Post date:** [June 24, 2019, 8:39pm UTC](https://forums.balena.io/t/solved-aggregating-logs-using-logspout-error-bind-mounts-are-not-allowed/16752/15 "2019-06-24T20:39:21Z")

</div>

For all those who stumble onto this thread, this image did the trick: [https://github.com/emdem/raspi-logspout](https://github.com/emdem/raspi-logspout)

Docker-compose looks like this:

```auto
  logspout:
      image: emdem/raspi-logspout
      command: 'syslog://XXX.papertrailapp.com:XXXXX'
      labels:
          io.balena.features.balena-socket: '1'

```

---

<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:** [June 24, 2019, 9:19pm UTC](https://forums.balena.io/t/solved-aggregating-logs-using-logspout-error-bind-mounts-are-not-allowed/16752/16 "2019-06-24T21:19:39Z")

</div>

Hi,  
thanks for sharing your findings with the balena comunity !  
Regards Thomas
