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

Change shelled out calls to Docker remote API #35

Closed
andystanton opened this issue May 11, 2015 · 4 comments
Closed

Change shelled out calls to Docker remote API #35

andystanton opened this issue May 11, 2015 · 4 comments
Milestone

Comments

@andystanton
Copy link
Member

The approach I've taken to #22 involves more shelled out calls to the Docker CLI. This is getting ugly and there may be a better way: talking to the Docker remote API directly and parsing the json it returns instead of hacking around with the arbitrary text returned by the CLI.

Boot2docker example query piped into jq:

curl \
    --insecure \
    --cert ~/.boot2docker/certs/boot2docker-vm/cert.pem \
    --key ~/.boot2docker/certs/boot2docker-vm/key.pem \
    https://$(boot2docker ip):2376/images/json \
| jq .

Gives a (much longer) version of this response:

[
  {
    "Created": 1422379591,
    "Id": "c90d655b99b2ec5b7e94d38c87f92dce015c17a313caeaae0e980d9b9bed8444",
    "Labels": null,
    "ParentId": "30d39e59ffe287f29a41a3f8bd70734afc8728329e3289945cbdc5bbf07cd980",
    "RepoDigests": [],
    "RepoTags": [
      "debian:latest"
    ],
    "Size": 0,
    "VirtualSize": 85014569
  }
]

In this thread, it's noted that the version of curl that comes with osx doesn't work with the above command (I've confirmed on Yosemite which is curl 7.30.0).

Running the latest curl downloadable through brew (7.42.0 currently) allows the command to work which is something to bear in mind when developing this change as I'm not sure what http libraries are available in go.

@andystanton andystanton added this to the v2.0.0 milestone May 11, 2015
@andystanton
Copy link
Member Author

Also useful: link to Docker remote API reference - https://docs.docker.com/reference/api/docker_remote_api/

andystanton added a commit that referenced this issue May 13, 2015
Initial work for calling Docker remote API instead of shelling out
commands. Uses hard coded boot2docker defaults. These will need to be
configurable to allow for boot2docker non-defaults and unix sockets.
@andystanton
Copy link
Member Author

go lang docs for network operations: https://golang.org/pkg/net/

andystanton added a commit that referenced this issue May 13, 2015
Continuing experimenting with Docker remote API.
@andystanton
Copy link
Member Author

I'm making good progress on this on branch feature/use-docker-remote-api but need to improve my understanding of the language as the Go I'm writing is poor.

@andystanton
Copy link
Member Author

Closing this in favour of #46, in which custom code calling the Docker CLI or remote API will be replaced by a library that does the same job.

@andystanton andystanton modified the milestones: v2.0.0, v1.0.4 Apr 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant