DEV Community

padaki-pavan
padaki-pavan

Posted on

Must try Docker feature

Working on docker can be time and disk consuming process. I discovered this feature recently, I feel like its really underrated.

Remote host via ssh

export DOCKER_HOST=ssh://user@123.432.543.234

setting this DOCKER_HOST flag will use your remote machine where docker is installed as the default host.

My workflow

I stored the above flag in my shell profile (zsh) and whenever I want to push some code, I update my docker-compose file and simply run respective build and start command and everything is pushed to my remote host automatically and securely using ssh, and without running a single container on my local machine. There's no need for me to have complex github actions and heroku setups etc. It just works!

Its been a real life saver for me, hope someone out there will find it useful as-well.

Top comments (3)

Collapse
 
harishagrawal profile image
Harish Agrawal

You can also try running the docker daemon remotely on tcp and then access in similar manner

Collapse
 
padakipavan profile image
padaki-pavan

Yes, that's was the only way to do it until recently ssh support was added. Which is more secure and one less port to expose.

Collapse
 
darshaneldorado profile image
Darshan kumar

This is a cool idea. As I spend time on heroku and push it for dev purpose and sometimes pipelines fail I do push from local. But this is an awesome feature. Thanks for sharing.