on current team, we're still transitioning docker toolbox docker windows. lot of our scripts still assume you're running docker toolbox on virtualbox (like how mount drives, how slashes or drive names work mounts).
is there reliable way tell, inside script, whether docker
coming docker toolbox or docker windows?
toolbox works via docker-machine
. way docker
client directed virtual machine via number of environment variables can see running docker-machine env default
set docker_tls_verify=1 set docker_host=tcp://192.168.99.100:2376 set docker_cert_path=/user/.docker/machine/machines/default set docker_machine_name=default rem run command configure shell: rem @for /f "tokens=*" %i in ('docker-machine env --shell cmd default') @%i
docker mac connects directly /var/run/docker.sock
socket mapped docker vm easy detect lack of environment variables.
i believe docker windows uses named pipe in same way (//./pipe/docker_engine
) should able tell lack of docker_host
in environment.
if docker windows still use environment, there differences between toolbox , docker windows variables. docker_host
on different range. docker_cert_path
won't include machine
etc.
Comments
Post a Comment