Skip to main content

whyWhy do you want to create a new managerManager node, risking damaging your raft consensus and cie...?

I find it way more easier to simply expose the docker socket locally like, as if you wherewere working inside the node, but with you windowsyour Windows environment.

To do so, simply open ana ssh tunnel that expose theexposes /var/run/docker.sock:

 ssh -M -S ~/.docker.sock \
     -fnNT -4 -L localhost:1337:/var/run/docker.sock \
     USER@MANAGER_IP
 

I let you referRefer to man ssh to see what all thisthese options meansmean. It

It will open an ssh tunneltunnel; you will still be onin your local environment shell, only thingsthing left to do is set the proper DOCKER_HOST environment var, so your docker cli is bindbound to your swarm manager.

  export DOCKER_HOST=localhost:1337

export DOCKER_HOST=localhost:1337

And that's it.

Note: Docker include also includes an option to do thisthis; I've quickly searchsearched for it but can't managermanage to find it. It's in the most recent version of docker.

why do you want to create a new manager node risking damaging your raft consensus and cie...

I find it way more easier to simply expose the docker socket locally like you where working inside the node but with you windows environment.

To do so simply open an ssh tunnel that expose the /var/run/docker.sock

 ssh -M -S ~/.docker.sock \
    -fnNT -4 -L localhost:1337:/var/run/docker.sock \
    USER@MANAGER_IP
 

I let you refer to man ssh to see what all this options means. It will open an ssh tunnel you will still be on your local environment shell, only things left to do is set the proper DOCKER_HOST environment var, so your docker cli is bind to your swarm manager.

  export DOCKER_HOST=localhost:1337

And that's it.

Note: Docker include also an option to do this I've quickly search for it but can't manager to find it. It's in the most recent version of docker.

Why do you want to create a new Manager node, risking damaging your raft consensus and cie?

I find it way easier to simply expose the docker socket locally, as if you were working inside the node, but with your Windows environment.

To do so, simply open a ssh tunnel that exposes /var/run/docker.sock:

 ssh -M -S ~/.docker.sock \
     -fnNT -4 -L localhost:1337:/var/run/docker.sock \
     USER@MANAGER_IP

Refer to man ssh to see what all these options mean.

It will open an ssh tunnel; you will still be in your local environment shell, only thing left to do is set the proper DOCKER_HOST environment var, so your docker cli is bound to your swarm manager.

export DOCKER_HOST=localhost:1337

And that's it.

Note: Docker also includes an option to do this; I've quickly searched for it but can't manage to find it. It's in the most recent version of docker.

Source Link
Juub
  • 156
  • 4

why do you want to create a new manager node risking damaging your raft consensus and cie...

I find it way more easier to simply expose the docker socket locally like you where working inside the node but with you windows environment.

To do so simply open an ssh tunnel that expose the /var/run/docker.sock

 ssh -M -S ~/.docker.sock \
    -fnNT -4 -L localhost:1337:/var/run/docker.sock \
    USER@MANAGER_IP

I let you refer to man ssh to see what all this options means. It will open an ssh tunnel you will still be on your local environment shell, only things left to do is set the proper DOCKER_HOST environment var, so your docker cli is bind to your swarm manager.

  export DOCKER_HOST=localhost:1337

And that's it.

Note: Docker include also an option to do this I've quickly search for it but can't manager to find it. It's in the most recent version of docker.