Reputation: 694
I'm trying to connect to remote docker host through ssh tunnel. I have forwarded the 2375
port and I'm trying to connect to it by specifying DOCKER_HOST
.
$ DOCKER_API_VERSION=1.24 DOCKER_HOST=localhost:2375 docker ps
error during connect: Get https://localhost:2375/v1.24/containers/json: http: server gave HTTP response to HTTPS client
This have worked before, but I can't make it work again, because my docker client keep giving me back this error. I can't make it ignore the https/http stuff. The connection is OK, i can curl the endpoints just fine, its just that docker client is doing something and then preventing itself from connecting and I don't know how to make it ignore the https.
Upvotes: 3
Views: 5581
Reputation: 694
I have finally figured out why I was getting this error. I was positive DOCKER_TLS_VERIFY
was not set, but it was. So if anyone get this error, make sure the env variable is undefined or that the value is empty.
using
$ DOCKER_API_VERSION=1.24 DOCKER_HOST=localhost:2375 DOCKER_TLS_VERIFY= docker ps
did work as expected.
Upvotes: 13