sysctls in docker-compose.yml

Hi,

I am trying to run the OpenThread border router, which needs to be ran with:

docker run --sysctl "net.ipv6.conf.all.disable_ipv6=0 \
    net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" \
    -p 8080:80 --dns=127.0.0.1 -it --volume \
    /dev/ttyACM0:/dev/ttyACM0 --privileged openthread/otbr \
    --radio-url spinel+hdlc+uart:///dev/ttyACM0

I’m in a multicontainer setup, so I tried to add sysctls field to my container, like that:

version: '2'
services:
  otbr:
    build:
      context: "./otbr"
    privileged: true
    command: --radio-url spinel+hdlc+uart:///dev/ttyACM0
    devices:
      - /dev/ttyACM0:/dev/ttyACM0
    sysctls:
      net.ipv6.conf.all.disable_ipv6: 0
      net.ipv4.conf.all.forwarding: 1
      net.ipv6.conf.all.forwarding: 1

Unfortunately, this fails with a Could not parse compose file: data/services/otbr should NOT have additional properties. Removing the sysctls field makes the error go away, but, as this page shows, it should be supported by the supervisor.

Am I doing something wrong?

Thanks!
Marvin

Hi, what OS version are you running?

I replicated this on our side and will keep you updated.

My bad, my RPi4 is running on balenaOS 2.51.1+rev1 (supervisor 11.4.10).

Thanks!

Hi, you should be able to make it work if you change the version to 2.1 in your docker-compose.yml

Thanks, it works.

You can maybe update the sample docker-compose.yml with version: '2.1', it would be more “foolproof” (but that’s totally my fault!).

You are welcome. Yeah, we’ll probably change that piece of documentation. Thanks for the heads-up

1 Like

Thank you for your awesome support. :slight_smile:
Have a good day!

Thank you. Have a nice day too!

Hi,

I am trying to get OpenThread Border Router going too. Did you have any luck with this?

Thanks,

Alex