Skip to content

Instantly share code, notes, and snippets.

@heptal heptal/docker.md
Last active Mar 9, 2016

Embed
What would you like to do?
Docker manager in Hammerspoon

Docker management menubar utility

Got tired of having to constantly manipulate the docker CLI commands for basic operations and for which the API has changed rapidly in the past year (much top-ranked info out there is out of date)

Assuming docker is installed (brew cask install dockertoolbox):

  • Start/stop/remove docker containers
  • Easily copy container IP to pasteboard addresses by just clicking
  • Conveniently open browser on container's exposed port
  • Open Kitematic GUI app included with dockertoolbox by clicking Docker

Get it here: docker.lua

Save as docker.lua in ~/.hammerspoon/ and put docker = require "docker" in your init.lua

I use lua-stdlib (installed with luarocks-5.3 install stdlib) for the keys function but you can just as easily have your own:

local keys = function(t)
  local keys={}
  for k, v in pairs(t) do
    table.insert(keys, k)
  end
  table.sort(keys)
  return keys
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.