Skip to content

Instantly share code, notes, and snippets.



Created Sep 15, 2017
What would you like to do?
Useful functions and aliases for Docker
# Open shell to a Docker Compose service container:
# use like: dsh # open shell to 'app' service (container name like project_app_1)
# dsh db # open shell to 'db' service
function dsh() {
docker exec -it $(docker-compose ps -q ${1:-$DEFAULT_SERVICE}) sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment