Skip to content

Instantly share code, notes, and snippets.

@luochen1990
Last active August 2, 2018 23:53
Show Gist options
  • Select an option

  • Save luochen1990/c34df194f0b8f252ec5932c3f9b74b47 to your computer and use it in GitHub Desktop.

Select an option

Save luochen1990/c34df194f0b8f252ec5932c3f9b74b47 to your computer and use it in GitHub Desktop.
the `dx` alias: a convenient wrapper of the `docker exec` command
docker_exec() {
matches=$( docker ps | grep $1 )
echo "$matches"
pid=$(echo $matches | awk "{print \$1}" )
echo Entering: $pid
docker exec -it $pid sh
}
alias dx="docker_exec"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment