Docker for the Geo People

Dec 24, 2017 | GIS, 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

First install of the new TN 911 Database

First install of the new TN 911 Database

If you're just tuning in I built a postgis database for the TN NG 911 project. What this has turned into is "small counties who can't/don't want to run with an ESRI solution". I posted the code up on github (and I realize every day I suck at github). So what did I...

QGIS2Web and the Hunt for Bike Lanes

QGIS2Web and the Hunt for Bike Lanes

I was teaching a QGIS class a while back and at one point the discussion drifted into "So this OpenStreetMap thing" and I discussed how I enjoy making edits. Eventually it turned to "I'm trying to get Chattanooga's Bike Lanes into it in my spare time". One thing led...

Training Classes for January 2024

Training Classes for January 2024

So I have 3 classes coming up in Mid January that I should have been talking about sooner but....December was a bit hectic. Exploring QGIS, Model Designer, and Tips and Tricks are happening. Jump over to the Support page and you'll see the info with links. I'm pretty...