我在Windows上已经使用Docker和boot2docker
有一段时间了,一切都运行良好。最近,我开始感到困扰的是,为了运行docker命令,我必须启动Boot2Docker
终端,并在那里键入boot2docker ssh
,然后从虚拟机中运行docker命令。我发现奇怪的是,在启动Boot2Docker终端(而没有ssh进入vm)之后,这是输出:
initializing...
Virtual machine boot2docker-vm already exists
starting...
Waiting for VM and Docker daemon to start...
.o
Started.
Writing C:\Users\user\.boot2docker\certs\boot2docker-vm\ca.pem
Writing C:\Users\user\.boot2docker\certs\boot2docker-vm\cert.pem
Writing C:\Users\user\.boot2docker\certs\boot2docker-vm\key.pem
To connect the Docker client to the Docker daemon, please set:
export DOCKER_HOST=tcp://192.168.59.103:2376
export DOCKER_CERT_PATH='C:\Users\user\.boot2docker\certs\boot2do cker-vm'
export DOCKER_TLS_VERIFY=1
IP address of docker VM:
192.168.59.103
setting environment variables ...
Writing C:\Users\user\.boot2docker\certs\boot2docker-vm\ca.pem
Writing C:\Users\user\.boot2docker\certs\boot2docker-vm\cert.pem
Writing C:\Users\user\.boot2docker\certs\boot2docker-vm\key.pem
export DOCKER_HOST=tcp://192.168.59.103:2376
export DOCKER_CERT_PATH='C:\\Users\\user\\.boot2docker\\certs\\bo ot2docker-vm'
export DOCKER_TLS_VERIFY=1
You can now use `docker` directly, or `boot2docker ssh` to log into the VM.
之后,我可以运行
boo2docker.exe ssh
,并从 vm docker 命令执行。但是,如果不进行 ssh 连接,则无法执行此操作。$ docker.exe
bash: docker.exe: command not found
我有什么遗漏吗?