Docker for the Geo People

Dec 24, 2017 | Open Source GIS, postgis

This might get lengthy. You have been warned. Docker people – settle down I’m new at this.

I dabbled in Docker  to get pgadmin4 up and running. A few months ago I tweeted (and I couldn’t find it) something derogatory about docker and virtual machines and what not. I was poked at for tweeting it. A few weeks after one person lamented why do the old school guys not embrace docker….because I’m old and that’s the way I likes it.

So something like 5 years ago I discovered Virtual machines. I was primarily running ESRI on everything and didn’t run anything in a Virtual Machine. Everything “just ran” and there was no need for one more complication in my life. One day I got a call and found myself going out of the country for a bit and I had been experimenting with dual booting my computer between windows/linux. Some more reading and I had loaded linux on my main workstation and moved my windows environment to a VM. I set up a VPN and suddenly everything is at my fingertips through SSH or VNC.

A couple of years after that – vagrant popped up on my radar. I could quickly deploy a ubuntu/debian server with fun things like a web server or a database or whatever I wanted. I could play with it and then delete it and adjust my VagrantFile to load more or less or compile software at startup.

Docker pops up. I’ve had a few false starts with it. When I started this I was determined I was going to write my own dockerfile. So I did. It didn’t work. I became irritated. I ended up getting one running. I threw a command against it. It left a container. So then I had images….and containers….and I did something else and I had two containers and I felt like I was junking up my computer. At one point I had like 15 containers and to me a VM seemed more natural. It’s a certain size. I know what is going to happen.  After RTFM’ing– I realized I didn’t have to “leave containers” all over the place. I didn’t have to keep an image. I could start and stop docker when I wanted.

So to really have some fun – I loaded the Kartoza DockerFile for PostGIS/Postgresql  (read the directions). In short I did this (and I’m on linux – but you can do this on windows): 

  1. docker pull kartoza/postgis
  2. sudo docker run –name “postgis” -p 25432:5432 -d -t kartoza/postgis
  3. psql -h localhost -U docker -p 25432 -d gis

I attached to it through the PSQL prompt and QGIS. I loaded data. It was fine. It was normal. If you think of it as a separate service running on your computer things get more “normal”. I have a lot of services I deal with every day from postgres to  ssh to dropbox etc. It’s just separate from the computer so you can’t break things. It’s self contained.

Maybe instead of a normal postgresql install I just load docker on my laptop and crank up Postgis/Postgresql when I need it. Maybe maybe maybe. I’m probably going to put pgadmin4 (through docker) on the postgis “server” I have running over in the corner. Maybe I get QGIS Server up and running in docker?

So I said it simplifies everything In my head……….once I “learn” enough to be proficient with it. Here’s my old man yelling at cloud moment.

ONE MORE THING I HAVE TO LEARN. Which may be why my old school comrades aren’t so quick to embrace this. I’m still flailing with GIT  on a good day.  So 18 years ago I had my first ArcGIS Desktop Experience. 18 YEARS AGO. I love this side of FOSS4G though – I have to learn something new. Which is why I sometimes hate the FOSS4G side of life – I can’t get comfortable and just go “Hey look I’m clicking buttons”. Some days there is comfort in clicking buttons – but I do the clients a disservice if all I can do is click buttons.

So I’m not going to a docker conference. I’m not going to write software and push it into docker for the masses. This isn’t a hammer for every nail I see……..BUT it is something you need to be paying attention to over the long haul. It’s another tool in your gistoolbox to make your life a bit more fun.

You may also like

The TN 911 Project – The Garage.

The TN 911 Project – The Garage.

I've been trying to write more as I get into this "New Life" thing since January. I'm not a developer. There was a time I did give it a go and it wasn't my thing. I can write small programs that scratch an itch but they aren't for mass consumption. I have found a...

I edited ArcPy Code

I edited ArcPy Code

It made me sad. I'm working on a project involving 911 data and it's made me do quite a bit of thinking. The short story on this is it's not in Tennessee. I'm taking data in it's raw form and shoving it into that state's NG911 format. So I have about half of it...

Update on the TN 911 Database

After not saying much up here for the last month - here's an update on the TN 911 Database. To catch you up if you don't know - Tn has a NG911 setup and generally 97% of everyone is running ESRI Arc Something to input data. A few years ago I moved one county over to...