2

I'm trying to run docker-compose behind a proxy masked by cntlm. In other words, my proxy settings are simply localhost:3128.

1) First of all, I created a new docker-machine setting the proxy and regenerating the certs:

HOST=10.16.13.232  # IP address of my Mac
PORT=3128  # port cntlm is listening

docker-machine create \
    --engine-env HTTP_PROXY=http://$HOST:$PORT \
    --engine-env HTTPS_PROXY=http://$HOST:$PORT \
    --engine-env NO_PROXY=*.local,169.254/16,localhost,127.0.0.*,10.*,192.168.*,*.example.com \
    -d virtualbox \
    --virtualbox-memory 2048 \
    --virtualbox-disk-size 102400 \
    my_new_machine

yes | docker-machine regenerate-certs my_new_machine

2) I set the ENV variables by hitting:

eval $("docker-machine env my_new_machine")

3) And in the current directory I've created my docker-compose.yml containing:

zookeeper:
  image: jplock/zookeeper
  container_name: zookeeper
  ports:
    - "2181:2181"
    - "2888:2888"
    - "3888:3888"

solr1:
  image: makuk66/docker-solr:4.10.4
  container_name: solr1
  ports:
    - "8983:8983"
  links:
    - "zookeeper:ZK"
  command: /opt/solr/bin/solr start -f -c -z zookeeper -a "-Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf -DnumShards=2"

solr2:
  image: makuk66/docker-solr:4.10.4
  container_name: solr2
  ports:
    - "8984:8983"
  links:
    - "zookeeper:ZK"
  command: /opt/solr/bin/solr start -f -c -z zookeeper

4) As final step, I proceed to hit docker-compose up, but I get the following error only if I'm behind my cntlm proxy:

ERROR: SSL error: hostname '192.168.99.100' doesn't match 'localhost'

Instead at home, WITHOUT ANY PROXY, docker-compose works well.

I tried by looking for any solution outside but I was not able to find/understand such solutions.

Any idea?

Thanks in advance :-)

Fernando Aspiazu
  • 953
  • 1
  • 10
  • 28
  • That looks like a self-signed certificate with incorrect alternative names. Did you set `subjectAltNames`? (http://stackoverflow.com/a/19290439/6309, http://stackoverflow.com/a/34350435/6309) – VonC Jan 25 '16 at 13:51
  • Mmm, nope... Is there any way to set subjectAltNames when launching `docker-machine create` command? – Fernando Aspiazu Jan 25 '16 at 16:39
  • By the way, I created a machine with name: local.mymachine.com, but the problem is still present – Fernando Aspiazu Jan 25 '16 at 16:40

2 Answers2

2

On Linux, if you installed docker compose with pip, uninstall it with:

pip uninstall docker-compose

and try to install it manually. This worked for me:

curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

If you have permission problems then you most probably cannot write to /usr/local/bin/docker-compose. --> Try with "sudo su".

Here the reference: https://docs.docker.com/compose/install/

enjoy! :-)

RichArt
  • 1,534
  • 18
  • 35
-1

With the last version of docker (1.11.1) docker-compose works well (also behind proxy)

Fernando Aspiazu
  • 953
  • 1
  • 10
  • 28