docker / docker/docker-py

docker service update pass options

Open
#2,612 0 comments 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

Hey guys,

I just gave up, I am trying to repeat the following command:

docker service update --config-rm "$OLD_CONFIG"\
 --config-add source="$NEW_CONFIG",target=/usr/local/tomcat/shared/classes/config.cfg,mode=0440\
 busybox_busybox

using Docker SDK for Python doc

...
client = docker.DockerClient(docker_server)
client.configs.create(name=new_config, data=data) - success
svc = client.services.get("busybox_busybox") - success
svc.update(!!!!!!!!!!!!)

and I can't understand how to pass these options "--config-rm abc" and "--config-add"
ps: I was able to create a external config but unable to update service by removing the old one and attaching the one i have created just a line ago

svc.update(image="nginx")
svc.update(command=["sh", "-c", "echo"]) - works fine but now the options I want to use

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 with the linked Service objects documentation and the svc.update entry point. Compare the Docker CLI --config-rm and --config-add operation with the update arguments exposed by the Python SDK, then verify that the service can remove the old config and attach the newly created one.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.