Last active
March 6, 2016 05:14
-
-
Save mildronize/956f780d2c49e6e5fbe1 to your computer and use it in GitHub Desktop.
No longer maintenance! Quick launch Boot2Docker on Windows: If the docker container is already running, skipping the step of initialized docker for quick launching
This file contains 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
#!/bin/bash | |
set -e | |
cd "$(dirname "$BASH_SOURCE")" | |
echo 'Checking Is docker running...' | |
STATUS="$(./boot2docker.exe status)" | |
echo | |
if [ "$STATUS" = "poweroff" ]; then | |
echo "Docker is poweroff" | |
./start.sh | |
else | |
echo "Docker is already running"`` | |
echo 'setting environment variables ...' | |
./boot2docker.exe shellinit | sed 's,\\,\\\\,g' # eval swallows single backslashes in windows style path | |
eval "$(./boot2docker.exe shellinit 2>/dev/null | sed 's,\\,\\\\,g')" | |
echo | |
echo 'You can now use `docker` directly, or `boot2docker ssh` to log into the VM.' | |
cd | |
exec "$BASH" --login -i | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment