gpt4 book ai didi

docker - 简单的docker命令不起作用:x509:无法验证证书

转载 作者:行者123 更新时间:2023-12-02 20:22:00 24 4
gpt4 key购买 nike

嗨,我刚刚安装了docker,我打开了cmd并创建了一个默认的docker机器:

C:\git>docker-machine create --driver virtualbox default
Running pre-create checks...
Creating machine...
(default) Copying C:\Users\NGT1IMB\.docker\machine\cache\boot2docker.iso to C:\Users\NGT1IMB\.docker\machine\machines\default\boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env default

C:\git>docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.11.2

C:\git>docker-machine env default
SET DOCKER_TLS_VERIFY=1
SET DOCKER_HOST=tcp://192.168.99.100:2376
SET DOCKER_CERT_PATH=C:\Users\NGT1IMB\.docker\machine\machines\default
SET DOCKER_MACHINE_NAME=default
REM Run this command to configure your shell:
REM @FOR /f "tokens=*" %i IN ('docker-machine env default') DO @%i

然后,当我尝试按照本教程进行操作时收到此错误:
C:\git>docker run hello-world
docker: An error occurred trying to connect: Post https://192.168.99.100:2376/v1.23/containers/create: x509: cannot vali
date certificate for 192.168.99.100 because it doesn't contain any IP SANs.
See 'docker run --help'.

任何答复,不胜感激。

最佳答案

原因是我落后于该公司的NLTM代理。因此,在创建默认VM时,
我必须设置代理:

docker-machine create -d virtualbox --engine-env HTTP_PROXY=http://<host>.<port> -engine-env HTTPS_PROXY=https://<host>.<port> default

此外,我正在使用CNTLM通过localhost:3128设置本地代理。
并且默认VM在具有NAT设置的Virtualbox上运行。所以我需要设置
HTTP_PROXY=http://192.168.99.1:3128
有关说明,请访问 here

感谢您的建议,vitr

关于docker - 简单的docker命令不起作用:x509:无法验证证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37609766/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com