Skip to content

Instantly share code, notes, and snippets.

@mxriverlynn
Last active August 7, 2016 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxriverlynn/0b3fc8ac228db3706a423c442829d6d5 to your computer and use it in GitHub Desktop.
Save mxriverlynn/0b3fc8ac228db3706a423c442829d6d5 to your computer and use it in GitHub Desktop.
simplify your "docker exec" with a "dexec" shell script

to use this script,

copy it to /usr/local/bin/

then in a folder where you are working on an app hosted in docker, add the name of your docker container to a .dockername file

echo my-container-name >> .dockername

now you can

dexec ps

to run ps (or any other command) inside of your docker container

#! /bin/sh
docker exec -it $(cat .dockername) "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment