docker / docker/docker-py

Question: Ulimit with services.create ?

Open
#3,343 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
1.7k
Avg merge
13d 8h
Merged PRs (30d)
2

Description

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 ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Python services.create entry point and compare its available options with the Docker CLI service create command shown in the issue. Trace how service creation options are sent to the Docker Engine API, then verify that a nofile ulimit can be passed and preserved when creating a service.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
api, devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.