Created
September 15, 2017 16:01
-
-
Save iBobik/0a579f7d0989c216845934b1bf0a35ca to your computer and use it in GitHub Desktop.
Useful functions and aliases for Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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