Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using docker and hosts file

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.

like image 425
ashic Avatar asked Apr 25 '26 16:04

ashic


1 Answers

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.

like image 153
VonC Avatar answered Apr 28 '26 06:04

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!