Skip to content

Question: Ulimit with services.create ? #3343

Open
@adb014

Description

@adb014

I'm trying to migrate some of my code to docker swarm and even though I can do

docker service create --ulimit nofile=66535 alpine sleep infinity

and I can do

import docker
_client = docker.from_env()
_container = _client.containers.run(image="alpine", command="sleep infinity", ulimits=[docker.types.Ulimit(name="nofile", soft=65535, hard=65535)], detach=True)

or even

import docker

_client= docker.from_env()
_service = _client.services.create(image="alpine", command="sleep infinity")

I however have no way of passing the ulimit value to the created service. Any ideas ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions