Created
February 8, 2017 20:38
-
-
Save garand/b83e63b2ea48e17195465a078611296b to your computer and use it in GitHub Desktop.
Bash script to open the currently running Docker container that is using port 80
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
docker-open() { | |
open http://${(L)$(hostname -s)}.local:`docker inspect --format='{{(index (index .NetworkSettings.Ports "80/tcp") 0).HostPort}}' $(docker-compose ps -q)` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment