Skip to content

Instantly share code, notes, and snippets.

@blueberrystream
Created August 17, 2018 10:20
Show Gist options
  • Save blueberrystream/69ffe7bb685273de447e783d03c66316 to your computer and use it in GitHub Desktop.
Save blueberrystream/69ffe7bb685273de447e783d03c66316 to your computer and use it in GitHub Desktop.
#!/bin/bash
# require peco (https://github.com/peco/peco)
# usage: doc-sh [SHELL]
id=`docker container ls | peco | awk '{print $1}'`
[[ -z "$id" ]] && exit
shell=$1
[[ -z "$shell" ]] && shell=bash
docker container exec -it $id $shell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment