Settings

Theme

Show HN: Docker CLI Plugin: Docker-swarm-proxy exec into a Docker service

github.com

1 points by ancieque 2 years ago · 0 comments · 1 min read

Reader

A problem with Docker Swarm and automation with it has been that you can't directly exec into any service from the command line. There exist some workarounds to achieve this behaviour, but in the end you want something similar and as convenient as `docker exec` but for services.

Recently I have been playing around with the idea of achieving this by deploying `tecnativa/docker-socket-proxy` in the swarm, and then using this to proxy to the proper host in the swarm you want to reach. It turns out that this works like a charm.

I recently played with a prototype for this where you had to first deploy the `tecnativa/docker-socket-proxy` stack into your swarm. Also you had to know which node the task was running on for this to be useful. I improved this situation. All you need to do is install the proper Docker CLI plugin I built, and you can get a shell into any service you need to. All you need is a connection to a Docker Swarm Manager:

docker swarmproxy service exec -it vibrant_bell bash

https://github.com/neuroforgede/docker-swarm-proxy

Maybe this is useful for some people around here :)

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection