Skip to content

Instantly share code, notes, and snippets.

@iBobik

iBobik/.bash_profile

Created Sep 15, 2017
Embed
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() {
DEFAULT_SERVICE=app
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