Must try Docker feature
padaki-pavan

padaki-pavan @padakipavan

About: Finding peace between bits

Location:
Bengaluru
Joined:
Nov 4, 2019

Must try Docker feature

Publish Date: Mar 25 '20
6 3

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.

Comments 3 total

  • Darshan kumar
    Darshan kumarMar 25, 2020

    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.

  • Harish Agrawal
    Harish AgrawalJun 11, 2020

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

    • padaki-pavan
      padaki-pavanJun 12, 2020

      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.

Add comment