Created
May 6, 2016 11:20
-
-
Save Markcial/148e0343a8ffef830ce2daae845fa34e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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