Git and Docker

Git and Docker

I have been using git for years. Heck, my college senior design project used it. However I wanted to take it to the next level. That along with my penchant to purge physical and digital crap, I started taking lots of stuff off my computer and storing it in the cloud.

GitHub and BitBucket are where I've started to put stuff. I started using BitBucket after the GitHub backlash a while back, and I still use that for my private repos. However the public ones, GitHub still seems easier and better to use. I'm even trying out putting my .RC files up there for when I get a new computer. I can just git clone that and get my vim, bash, etc setup there in one line.

My other latest personal improvement is teaching myself a lot more about Docker. While the initial need was work related, I needed some meaningful way to teach it to myself.

So I setup a box on Azure. I originally did it as a VM on my machine, but turns out Docker doesn't play well with 32 bit OS. The VM took minutes to setup and configure on Azure and says it will only cost ~$14 a month (we will see when I get my first bill). Then I deployed this app on the VM via docker hub. It worked really well and was pretty easy. That is once I got the storage redirected right. In case you aren't aware, the docker container is transient. So if it stops, if you did not redirect the storage, when you restart it, it will start from the baseline again. That means no posts, no config, etc. However once I got the syntax right, I was good. In case you are wondering, the error was that I had two spaces before the docker image name...

Next up was making my own image. I had code I frequently put all over the place on different VMs for work. It is simple python scripts that simulate what a router or switch may respond with when you SSH to them. The process isn't too hard: install python, move scripts, add some users, make the default shell of those users the scripts you moved over, etc. However now that I already had that on GIT, might as well just write a dockerfile to do that all for me! The hardest part was figuring out the CMD to run at the end so that the container didn't end immediately. However once I got that done, it works beautifully. So far I deployed it on three machines and it all worked flawlessly, something that wasn't always the case when I deployed it manually since I often skipped steps.

I will certainly work more with this in the future.