Compose: Add 'sysctl' option support

Created on 26 Jul 2016  Â·  23Comments  Â·  Source: docker/compose

PR https://github.com/docker/docker/pull/19265 merged 'sysctl' support into docker, but there seems to be no way to use this feature with docker-compose. Has anyone started work on such a feature? If not, I will attempt to patch docker-compose and create a PR. Are there any suggestions on how to implement it? I was thinking of starting with something similar to how the environment or cap_add options work.

Most helpful comment

Guys any progress? Need this feature to run latest version of Elasticsearch from docker-compose...

All 23 comments

+1

I've submitted a PR for this to docker-py in docker/docker-py#1145. I have a patch for docker-compose in my tree at 87ea3c40f71c4b87e2292244a276a53765f484e6. Will submit my patch here once docker-py support is accepted.

+1

+1

+1

+1

+1

Anything happening here?

3798 closes this. docker-py version 1.10.0 added support for sysctls, so I hope we can get this merged soon.

I followed instruction https://docs.docker.com/compose/gettingstarted/ . but it does not work ......

Has anyone got the instruction working?

Guys any progress? Need this feature to run latest version of Elasticsearch from docker-compose...

+1

Also waiting for this to make our lives easier :)

+1

+1

Guys sorry for annoying, when it becomes available in release?

FYI

There is sysctls option starting from docker-compose 2.1

Docker-compose 3.0+ support this feature (sysctls)?

@agiUnderground, yes

@AnatolyRugalev can you give me a link or some example please? I trying to start redis as docker service in docker stack and i wanna change /proc/sys/net/core/somaxconn option.

I found this message, that make me sad(
"Note: This option is ignored when deploying a stack in swarm mode with a (version 3) Compose file."

+1

How to fix error below.

Error Message:

ubuntu@VM-0-10-ubuntu:~/dk$ docker-compose up redis
Starting redis-con ... error

ERROR: for redis-con  Cannot start service redis: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"open /proc/sys/net/core/somaxcomm: no such file or directory\"": unknown

ERROR: for redis  Cannot start service redis: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"open /proc/sys/net/core/somaxcomm: no such file or directory\"": unknown
ERROR: Encountered errors while bringing up the project.

docker-compose.yml:

version: '3'
services:
  redis:
    image: redis:3.2.12
    container_name: redis-con
    privileged: true
    sysctls:
      net.core.somaxcomm: '511'

Typo? Should be somaxconn, not ‘comm’?

On Jul 6, 2018, at 07:29, ercom notifications@github.com wrote:

How to fix error below.

Error Message:

ubuntu@VM-0-10-ubuntu:~/dk$ docker-compose up redis
Starting redis-con ... error

ERROR: for redis-con Cannot start service redis: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"open /proc/sys/net/core/somaxcomm: no such file or directory\"": unknown

ERROR: for redis Cannot start service redis: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"open /proc/sys/net/core/somaxcomm: no such file or directory\"": unknown
ERROR: Encountered errors while bringing up the project.
docker-compose.yml:

version: '3'
services:
redis:
image: redis:3.2.12
container_name: redis-con
privileged: true
sysctls:
net.core.somaxcomm: '511'
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Was this page helpful?
0 / 5 - 0 ratings