Skip to content

Instantly share code, notes, and snippets.

@mildronize
Last active March 6, 2016 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mildronize/956f780d2c49e6e5fbe1 to your computer and use it in GitHub Desktop.
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
#!/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