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

Docker daemon support #144

Closed
TheFriendlyCoder opened this issue Jan 26, 2022 · 4 comments
Closed

Docker daemon support #144

TheFriendlyCoder opened this issue Jan 26, 2022 · 4 comments

Comments

@TheFriendlyCoder
Copy link

I just discovered your project and was testing it out for some of the projects I work on which use the Docker REST APIs to interact with the Docker daemon to orchestrate container operations. Unfortunately I'm getting errors in my projects because I am unable to connect to the same API endpoints as those exposed by Docker. Do you support container orchestration via REST APIs or expose an API that is compatible with the Docker daemon? If so, how do I go about setting up my environment to work with it?

@TheFriendlyCoder
Copy link
Author

For context, if you run any of the examples provided in the Docker SDK docs showing how to do basic interactions with Docker using the API, none of them work. For example:

curl --unix-socket /var/run/docker.sock http://localhost/v1.41/containers/json

just returns:

curl: (7) Couldn't connect to server

Similar problems happen when using the dockerpy library for Python as well.

@TheFriendlyCoder
Copy link
Author

I just figured out the cause of my problem. For others benefit, it looks like the default unix socket used by the Docker daemon is located under /var/run/docker.sock. However, colima puts this socket in the current users' home folder under ~/.colima/docker.sock. Updating your connection parameters to compensate should fix the problem, as in:

curl --unix-socket /Users/kevinp/.colima/docker.sock http://localhost/v1.41/containers/json

@sdemura
Copy link

sdemura commented Jan 28, 2022

I was able to ln -sf ~/.colima/docker.sock /var/run/docker.sock worked for me.

@gregorybosch
Copy link

Working well for me thus far. I had forgotten to remap a couple of volumes on colima startup. Thanks for the fix.

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

3 participants