Skip to content

Instantly share code, notes, and snippets.

@Markcial
Created May 6, 2016 11:20
Show Gist options
  • Save Markcial/148e0343a8ffef830ce2daae845fa34e to your computer and use it in GitHub Desktop.
Save Markcial/148e0343a8ffef830ce2daae845fa34e to your computer and use it in GitHub Desktop.
function docker-find --description 'Finds a container by hostname'
set -l hosts
set -l hostname $argv[1]
for container in (docker ps -a -q)
if test (docker inspect --format "{{ .Config.Hostname }}" $container) = $hostname
echo $container
end
end
return 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment