Using docker and hosts file

2019-05-14 13:16发布

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条回答
迷人小祖宗
2楼-- · 2019-05-14 13:51

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.

查看更多
登录 后发表回答