Skip to content

Instantly share code, notes, and snippets.

@srgrn
Created May 14, 2015 02:08
Show Gist options
  • Select an option

  • Save srgrn/8cfdf1c4ad2642925e54 to your computer and use it in GitHub Desktop.

Select an option

Save srgrn/8cfdf1c4ad2642925e54 to your computer and use it in GitHub Desktop.
docker-machine-set-env-on-cmd
1. open cmd
2. ensure your env is up
`docker-machine ls`
3. run `set DOCKERENV='your env name'`
4. run the following command ` echo @echo off > %TEMP%\%DOCKERENV%.bat && ( docker-machine.exe env %DOCKERENV% | sed 's/export/set/'
| sed 's,\\\\\\\\,\\\\,g' | sed 's,#,rem,g') >> %TEMP%\%DOCKERENV%.bat && %TEMP%\%DOCKERENV%.bat %% del
%TEMP%\%DOCKERENV%.bat`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment