jueves, 19 de marzo de 2020

TRAMP with docker is awesome

There's this recent post in reddit where the author shows how to chain tramp connections. And it's great indeed!

What I'm using TRAMP more often for is to login to containers.

Using docker-tramp, I usually browse into a docker and start dired there. But then, I can open a shell (or eshell if there's no bash) there.

And, for example, if you run a postgres container, why not opening a `sql-postgres` buffer?.

Just:

docker run -e POSTGRES_PASSWORD=a -e POSTGRES_USER=rgrau -ti --rm postgres

and when dired-ing through tramp, m-x sql-postrgres using the appropriate params.  Tada!

Neat, ain't it?

Happy hacking, and stay safe.

No hay comentarios: