Skip to content

Instantly share code, notes, and snippets.

@blueberrystream
Created August 17, 2018 10:17
Show Gist options
  • Save blueberrystream/8d4e970084662f672b215ced3dbeca47 to your computer and use it in GitHub Desktop.
Save blueberrystream/8d4e970084662f672b215ced3dbeca47 to your computer and use it in GitHub Desktop.
#!/bin/bash
# require peco (https://github.com/peco/peco)
# usage: fig-sh [SHELL]
id=`docker-compose ps | 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