Created
April 20, 2017 13:38
-
-
Save nathanl/35cdef3494f5012321dbbc5471bad910 to your computer and use it in GitHub Desktop.
Revisions
-
nathanl created this gist
Apr 20, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ #!/bin/bash # Shell into the Docker container with the given name. # eg: `docker-bash my_app` # Note: fails if more than one id is returned. ID=$(docker-id $1) docker exec -it $ID bash 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ #!/bin/bash # Output the id(s) of running Docker containers with the given name. # eg: `docker-id my_app` docker ps |grep $1 |cut -d' ' -f 1 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ #!/bin/bash # Shell into the Docker container with the given name. # eg: `docker-sh my_app` # Note: fails if more than one id is returned. ID=$(docker-id $1) docker exec -it $ID sh