Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker-machine create node without tls verification

When I create a node with docker-machine

docker-machine create -d virtualbox node1

it is created with tls verification enabled for docker deamon which made things a bit more of a hassle than normal for swarm.

I want to create a node with docker-machine without tls verification for testing purpose.

I tried with:

docker-machine create -d virtualbox --engine-tls false node1

and

docker-machine create -d virtualbox --engine-tls-verify false node1

and

docker-machine create -d virtualbox --engine-opt-tls false node1
like image 640
Montells Avatar asked Jun 08 '15 19:06

Montells


People also ask

How do you expose Docker daemon without TLS?

on the Notification bar, select Settings from the context menu, and then select the Expose daemon on tcp://localhost:2375 without TLS checkbox in the General section of your system Docker settings.

How to enable TLS in Docker?

If you need Docker to be reachable through HTTP rather than SSH in a safe manner, you can enable TLS (HTTPS) by specifying the tlsverify flag and pointing Docker's tlscacert flag to a trusted CA certificate. In the daemon mode, it only allows connections from clients authenticated by a certificate signed by that CA.

What is Docker_tls_verify?

DOCKER_TLS_VERIFY is a environment variable and not a docker daemon config file options. See: https://docs.docker.com/engine/reference/commandline/dockerd/#/daemon-configuration-file for the documentation.

What is Docker daemon socket?

sock is basically the Unix socket the Docker daemon listens on by default. It is also a tool used to communicate with the Docker daemon from within a container. Sometimes, containers need to bind mount the /var/run/docker. sock file. Communication with container from docker daemon.


3 Answers

I use commands below:

docker-machine create -d virtualbox --engine-env DOCKER_TLS=no node1

And then ssh to the node to execute docker commands:

docker-machine ssh node1
$ docker info
like image 105
ax003d Avatar answered Oct 22 '22 09:10

ax003d


try:

docker-machine create -d virtualbox --engine-opt tlsverify=false node1

and after running:

eval "$(docker-machine env node1)"

run:

unset DOCKER_TLS_VERIFY
like image 6
Tal Muskal Avatar answered Oct 22 '22 07:10

Tal Muskal


This worked best for me:

docker-machine create -d virtualbox --engine-env DOCKER_TLS=no --engine-opt host=tcp://0.0.0.0:2375 node1

This way it binds to 2375 in addition to 2376. 2375 is the tradition for non-tls daemons.

like image 5
Joel Avatar answered Oct 22 '22 09:10

Joel