Skip to content

Instantly share code, notes, and snippets.

@cloud8421
Last active September 9, 2015 12:38
Show Gist options
  • Save cloud8421/686f321523fd2477a2c4 to your computer and use it in GitHub Desktop.
Save cloud8421/686f321523fd2477a2c4 to your computer and use it in GitHub Desktop.
Docker shell helpers
findcontainer() {
local containers container
containers=$(docker-compose ps | tail -n +3 | awk '{print $1}') &&
container=$(echo "$containers" | fzf -x) &&
echo $container
}
dshell() {
local result=$(findcontainer)
docker exec -it $result /bin/bash
}
dlog() {
local result=$(findcontainer)
docker logs -f $result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment