Skip to content

Instantly share code, notes, and snippets.

@ivalentinee
Last active February 22, 2017 11:20
Show Gist options
  • Save ivalentinee/d874fbe122a2d6892227 to your computer and use it in GitHub Desktop.
Save ivalentinee/d874fbe122a2d6892227 to your computer and use it in GitHub Desktop.
docker_compose_exec() {
docker exec -it $(docker-compose ps | grep $1 | awk '{print $1}') ${@:2}
}
alias dcrun='docker_compose_exec web'
alias dcenter='docker_compose_exec web bash'
alias dcenter_new='docker-compose run web bash' # if container is not up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment