Created
February 4, 2016 09:50
-
-
Save qbikez/da535d22a507fe8e2be8 to your computer and use it in GitHub Desktop.
docker-quickstart-terminal for CMD
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
@echo off | |
REM !/bin/bash | |
REM trap '[ "$?" -eq 0 ] || read -p "Looks like something went wrong... Press any key to continue..."' EXIT | |
set VM=default | |
set DOCKER_MACHINE="./docker-machine.exe" | |
REM if [ ! -z "$VBOX_MSI_INSTALL_PATH" ]; then | |
REM VBOXMANAGE=${VBOX_MSI_INSTALL_PATH}VBoxManage.exe | |
REM else | |
REM VBOXMANAGE=${VBOX_INSTALL_PATH}VBoxManage.exe | |
REM fi | |
set BLUE= | |
set GREEN= | |
set NC= | |
REM set BLUE=\033[1;34m | |
REM set GREEN=\033[0;32m | |
REM set NC=\033[0m | |
REM if [ ! -f $DOCKER_MACHINE ] || [ ! -f "${VBOXMANAGE}" ]; then | |
REM echo "Either VirtualBox or Docker Machine are not installed. Please re-run the Toolbox Installer and try again." | |
REM exit 1 | |
REM fi | |
REM "${VBOXMANAGE}" showvminfo $VM &> /dev/null | |
REM VM_EXISTS_CODE=$? | |
REM set -e | |
REM if [ $VM_EXISTS_CODE -eq 1 ]; then | |
REM $DOCKER_MACHINE rm -f $VM &> /dev/null || : | |
REM rm -rf ~/.docker/machine/machines/$VM | |
REM $DOCKER_MACHINE create -d virtualbox $VM | |
REM fi | |
REM | |
REM VM_STATUS=$($DOCKER_MACHINE status $VM 2>&1) | |
REM if [ "$VM_STATUS" != "Running" ]; then | |
%DOCKER_MACHINE% start %VM% | |
%DOCKER_MACHINE% regenerate-certs %VM% -f | |
REM yes | $DOCKER_MACHINE regenerate-certs $VM | |
REM fi | |
REM eval "$($DOCKER_MACHINE env --shell=bash $VM)" | |
docker-machine env --shell cmd default3 | |
FOR /f "tokens=*" %%i IN ('%%DOCKER_MACHINE%% env --shell cmd %%VM%%') DO %%i | |
for /f "delims=" %%i in ('%%DOCKER_MACHINE%% ip %%VM%%') do set IP=%%i | |
cls | |
echo ## . | |
echo ## ## ## == | |
echo ## ## ## ## ## === | |
echo /"""""""""""""""""\___/ === | |
echo ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~ | |
echo \______ o __/ | |
echo \ \ __/ | |
echo \____\_______/ | |
echo. | |
echo. | |
echo %BLUE%docker%NC% is configured to use the %GREEN%%VM%%NC% machine with IP %GREEN% %IP% %NC% | |
echo For help getting started, check out the docs at https://docs.docker.com | |
echo. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment