Docker-transmission-openvpn: sysctls option won't work with docker-compose

Created on 12 Mar 2019  ·  6Comments  ·  Source: haugene/docker-transmission-openvpn

Hi,

I'm trying to have my container launch without ipv6 in a docker compose YML.

Here is my YML

```container.name:
container_name: container.name
image: haugene/transmission-openvpn:latest
restart: unless-stopped
mem_limit: 1024m
sysctls:

  • net.ipv6.conf.all.disable_ipv6=1
    ports:
  • “9091:9091”
    environment:
  • TZ=Europe/Paris
  • PUID=1000
  • PGID=1000
    volumes:
  • ~/container.name/vol_01:/data
    cap_add:
  • NET_ADMIN
    devices:
  • /dev/net/tun
    dns:
  • 1.1.1.1
  • 1.0.0.1
When I launch the container via docker-compose up, I've got this error:

ERROR: The Compose file ‘./docker-compose.yml’ is invalid because:
Unsupported config option for container.name: ‘sysctls’

Any ideas, bad indentation or something else ?

Cheers !

Most helpful comment

It seems that I managed to deactivate ipv6,using version 3 of docker compose.

I'm not getting a lots of error saying:

Couldn't connect socket 50 to ipv6.....

Thanks a lot for your support, and long live to haugene transmission-openvpn !

See ya.

All 6 comments

up

Right. This is not an issue with the container/image. And yes, docker-compose supports sysctls option.
Please read the docs for docker-compose: https://docs.docker.com/compose/compose-file/

The sysctls option is introduced in version 2.1, so you need to use that version or a newer one. And I can't see that you are specifying the version at all. Basically, if you just copy the example docker-compose from this repo and change version to 2.1 you should be able to add container_name and sysctls for the transmission service.

Thanks for the answer,

I know this isn't an issue, sorry to bother you, but I've posted on docker hub forum, no answer there.

I will try to specify the version in the YML.

Thanks a lot.

By the way, great job with this container, pretty simple to use and very efficient !

Thank you :) And don't get me wrong - I know the feeling of syntax errors and that it can be tricky to figure it out. But it's also a lot of issues being raised here that is Docker and docker-compose specific. Not to mention just normal networking etc. I need to figure out a way to handle it, or not handle it to be more precise.

Btw. Using the dev version of the image you don't need to mount the tun device either. So you could do something like this:

version: '2.1'
services:
 transmission:
  image: haugene/transmission-openvpn:dev
  container_name: some-container-name
  cap_add:
    - NET_ADMIN
  restart: unless-stopped
  ports:
    - "9091:9091"
  dns:
    - 8.8.8.8
    - 8.8.4.4
  volumes:
    - /your/storage/path/:/data
  sysctls:
    - net.ipv6.conf.all.disable_ipv6=1
  environment:
    - OPENVPN_PROVIDER=provider
    - OPENVPN_USERNAME=username
    - OPENVPN_PASSWORD=password
    - OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60
    - LOCAL_NETWORK=192.168.0.0/24
    - PUID=1000
    - PGID=1000

It seems that I managed to deactivate ipv6,using version 3 of docker compose.

I'm not getting a lots of error saying:

Couldn't connect socket 50 to ipv6.....

Thanks a lot for your support, and long live to haugene transmission-openvpn !

See ya.

Great. Haha, long live 👍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pejotll picture pejotll  ·  4Comments

lorgio picture lorgio  ·  4Comments

PriamX picture PriamX  ·  3Comments

niXta1 picture niXta1  ·  3Comments

callahan22 picture callahan22  ·  4Comments