I have downloaded Docker Toolbox on to a Windows 7 machine, but have found that unless you run a specific "FOR" command when using the command prompt you are unable to run Docker.
Following instructions from a different Stack Overflow question I know to run:
docker-machine env default
Which returns something like this:
SET DOCKER_TLS_VERIFY=1
SET DOCKER_HOST=tcp://ip.address
SET DOCKER_CERT_PATH=path\to\default
SET DOCKER_MACHINE_NAME=default
SET COMPOSE_CONVERT_WINDOWS_PATHS=true
REM Run this command to configure your shell:
REM @FOR /f "tokens=*" %i IN ('docker-machine env default') DO @%i
Running the bottom command from the command line allows that terminal session to then run docker commands until it is closed then upon re-opening it needs to be ran again.
Whilst this isn't an issue I am trying to find a way where I can set this environment up via ant in order to run some docker commands I have in an existing ant build.
So far I have tried:
<exec command="REM @FOR /f "tokens=*" %i IN ('docker-machine env default') DO @%i
Along with making a seperate batch file with the commands in and calling that via my build but every time there is either no error and then the docker commands don't work or something along the lines of
Cannot run program "FOR"; CreateProcess error=2, the system cannot find the file specified.
For anyone else that ever comes across this issue, setting the environment variables in the Windows System properties is the fix.
I have written a small target within my build to do this set up, all you need to do is fill in the values with the output from:
docker-machine env default
to fit this format:
<exec executable="setx">
<arg value="DOCKER_TLS_VERIFY"/>
<arg value="1"/>
</exec>
SETX is the program used to set environment values, but Eclipse will need to be restarted the first time after you run these commands but after that you will be able to run Docker commands from the command line or through Eclipse without having to do any set up.