analogsea icon indicating copy to clipboard operation
analogsea copied to clipboard

Ideas for revamped docklet API

Open wch opened this issue 11 years ago • 2 comments

Right now, the docklet_* functions are basically wrappers for droplet_ssh that put "docker" as the first argument in the command. I suggest changing it so that a "docklet" (or some other name) is an object which refers to a specific docker container running on a droplet. You might have some functions like:

  • docklet_run(droplet, image, name): returns a docklet (not droplet) object.
  • docklet_kill(docklet)
  • docklet_running(docklet): returns TRUE if container is running.

Also, there would be some functions that operate on the docker system as a whole:

  • docker_images(droplet)
  • docker_pull(droplet, image)

And so on.

Now that I think of it some more, maybe this should be spun out into a separate package so that it could be used with other systems besides Digital Ocean - and even control local docker installations, in their various flavors (i.e., docker and boot2docker).

Thoughts?

wch avatar Oct 22 '14 01:10 wch

@wch I agree on the re-worked API and the separate package. @hadley ?

On the docklet API, I think that makes sense because we've made the droplet_* functions work on individual droplets, whereas with docklet_* functions you need to pass an image name to them, where there can be many within a droplet.

sckott avatar Oct 22 '14 02:10 sckott

I got started here: https://github.com/wch/harbor. If you guys want to be added to the repo, just let me know.

The function names will be container_* for commands specific to a particular container, and docker_* for commands for the docker system as a whole.

If you have suggestions for a better name, I'm open to suggestions -- there's a slight mismatch between the package name (harbor) and the command names (docker_*).

wch avatar Oct 22 '14 03:10 wch