My code

docker-machine create --driver virtualbox dev

VBoxManage list vms

"minikube" {9c326ed5-faf4-42fe-acda-bf3a283f1a74}
"kalinew" {de6de631-0d51-4638-b967-66db463cbf05}
"dev" {84a116bf-02b9-48e3-809a-f5232518c8ee}


eval "$(docker-machine env dev)"

My goal was to check with echo

echo $dev

Got empty line. Why?


Because docker-machine env dev doesn't set the environment variable dev, it sets environment variables for the host called dev.

Run docker-machine env dev without the eval to see what environment variables get set. Also compare with the output of docker-machine env (without dev) if your docker-machine configuration is wrong somewhere, but still has a reasonable default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.