Using docker and hosts file

余生长醉 提交于 2019-12-07 13:29:38

问题


I'm trying to get an hbase container running, and the container requires some stuff which means the docker host need to be available as "docker". We achieve this with setting the docker ip in the hosts file with docker. However, when I run:

docker ps

it tells me that the certificate is for localhost and not docker. The following works:

docker --tlsverify=false ps

My questions are: * Is it possible to "update" something so that docker ps works? * Is it possible to turn off tls verification through some environment variable?

I tried setting DOCKER_TLS_VERIFY to 0, and that didn't work. I know turning off tls is insecure, but this is for dev, and other automated scripts expect to run without specifying --tlsverify=false.


回答1:


You could consider (for testing) to generate a certificate for docker and localhost (adding the latter in SubjectAltName)

Adding localhost to Subject Alternative Name can have drawbacks, but in your case, it would allow docker ps to run properly anywhere.



来源:https://stackoverflow.com/questions/34336319/using-docker-and-hosts-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!