Since 1.6.1 isn't able to talk to non-TLS docker hosts (eg. local environments). 1.6.0 was working without TLS.
docker-compose build
ERROR: TLS configuration is invalid - make sure your DOCKER_TLS_VERIFY and DOCKER_CERT_PATH are set correctly.
Happens whenexport DOCKER_TLS_VERIFY=
is executed before docker-compose
since 1.6.1. AFAIK it was needed before.
Bug?
Please try with 1.6.2, we fixed a TLS issue with 1.6.1.
Doesn't work with 1.6.2 if DOCKER_TLS_VERIFY set to empty string (or "0"). It's only working if DOCKER_TLS_VERIFY is not set.
Confirmed. I think this is the offending line: https://github.com/docker/docker-py/pull/924/files#diff-193b0cbc51c3ae87519912dd6aeadec4R457
Looks like if DOCKER_TLS_VERIFY
is set to the empty string, we assume that you do want TLS, even if you haven't set a cert path. This doesn't match the behaviour of the Docker CLI, which as far as I can tell treats an empty string value identically to the absence of the variable.
Incidentally, 0
is not a falsy value in this case. Running against a non-TLS daemon:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$ DOCKER_TLS_VERIFY= docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$ DOCKER_TLS_VERIFY=1 docker ps
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
$ DOCKER_TLS_VERIFY=0 docker ps
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Current workaround:
unset DOCKER_TLS_VERIFY
Also unset DOCKER_CERT_PATH if you had that set.
unset DOCKER_TLS_VERIFY
unset DOCKER_CERT_PATH
Fresh install of docker-compose 1.7.1. I can confirm this is still an issue.
Issue grooming: After such a long time with no further reports I'm going to assume this was fixed and close. If you are still having this issue with modern versions please open a fresh issue
Had this issue in IntelliJ IDEA, doing this helped:
This is not a docker-compose issue, it's IntelliJ issue, it's adding this env variables when it shouldn't be, but this is one of the top results on Google, so I decided to post my solution in case anyone else is in the same situation.
Most helpful comment
Had this issue in IntelliJ IDEA, doing this helped:
This is not a docker-compose issue, it's IntelliJ issue, it's adding this env variables when it shouldn't be, but this is one of the top results on Google, so I decided to post my solution in case anyone else is in the same situation.