Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command line tools needed for talking to docker daemon in a shell script #885

Closed
jizhilong opened this issue Dec 24, 2015 · 8 comments
Closed

Comments

@jizhilong
Copy link

Hi, guys.In some circumstance, such as building images in a jenkins container, I need to run some commands like docker tag, docker push, etc.But I don't want to install another binary package for docker client in the jenkins container, so I made a trade-off by using commands like python -c "from docker import client;client.Client(version='1.20').push('10.18.5.203:8080/mypackage','$commit_id', insecure_registry=True)", and such long commands make my scripts messy.If there was a command line tool dockerpy, those long commands can be simplified with dockerpy push -v 1.20 --insecure_registry 10.18.5.203:8080/mypackage:$commit_id.

@TomasTomecek
Copy link
Contributor

It's not that hard to implement such thing yourself. I would actually open such request, providing a client without server overhead, at docker engine tracker.

@dnephin
Copy link
Contributor

dnephin commented Dec 27, 2015

But I don't want to install another binary package for docker client ... If there was a command line tool dockerpy

These are conflicting requirements, you don't want to install one binary, but you want to create another one that will be installed?

I don't think there is any reason to create a dockerpy binary that would be a clone of the docker cli binary.

It is possible to build a client-only binary from the current docker/docker repo.

@jizhilong
Copy link
Author

These are conflicting requirements, you don't want to install one binary, but you want to create another one that will be installed?

Not conflicting actually, since docker-py is already on our pip requirements list, and no extra overhead of installing another binary would be added if there is a dockerpy cli tool within the docker-py repo.

It is possible to build a client-only binary from the current docker/docker repo.

It's possible, but not as simple and straightforward as a line of command pip install docker-py .

@dustymabe
Copy link

This feature request might be relevant: #1031

@jizhilong
Copy link
Author

build client binary from docker/docker is not that complicated, I'll close this issue.

@TomasTomecek
Copy link
Contributor

In 1.12, there was a split in packaging. docker binary is a client only since then: moby/moby#20639

@jizhilong
Copy link
Author

@TomasTomecek thanks for the sharing.

@dustymabe
Copy link

hey all. you can also use https://github.com/containscafeine/shipy that @containscafeine wrote. It is just a few python files that builds on docker-py and you can use it like: python shipy run --name batman -p 8080:8080 centos ping 8.8.8.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants