Skip to content

Instantly share code, notes, and snippets.

@andrearota
Created December 15, 2017 14:37
Show Gist options
  • Save andrearota/b033f7688e3c8b2bc7079c4808c4531f to your computer and use it in GitHub Desktop.
Save andrearota/b033f7688e3c8b2bc7079c4808c4531f to your computer and use it in GitHub Desktop.
Autostart Docker Machine and a Docker container in Windows <10
@echo on
REM Script for booting the Docker machine and to start the container at startup
REM This file should be scheduled in Windows automatic execution folder
REM Set the path of Docker tools
set PATH=%PATH%;"C:\Program Files\Docker Toolbox\"
REM Set the name of the VM configuration where Docker daemon will be hosted
REM The docker machine below should exist!
set BOOT2DOCKER_VM=inference
REM Boot the Docker the machine
docker-machine start %BOOT2DOCKER_VM%
REM Set the environment variables to use docker-machine and docker commands
REM Note the double %% used to escape %.
@FOR /f "tokens=*" %%i IN ('docker-machine env --shell cmd %BOOT2DOCKER_VM%') DO @%%i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment