VB6 to Docker Tutorial
by John Browne, on Nov 29, 2018 6:02:00 AM
Extinction is normal
The word "extinction" makes me visualize a couple of dinosaurs, seeing a huge fireball in the sky rushing toward Earth. One says to the other, "Wonder what the hell that is?" The other one says, "Ah, probably nothing."
I know a guy, call him Will, who worked at Kodak when they made the first digital cameras. My friend Will, kept running around Rochester saying that this was a hair on fire moment, because digital cameras directly threatened the film franchise that Kodak was built on. Kodak management--whose predecessors literally invented the consumer camera industry--ignored all the warning signs. Digital, they said, was inferior to film. Digital, they said, was expensive. There were no digital cameras, but there were billions of film cameras (now available at your local flea market).
Digital will never replace film.
Right.
Cars will never replace buggies. Email will never replace snail mail. PCs will never replace mainframes. Ecommerce will never replace retail. The Cubs will never win the World Series.
Running in fear
When the iPad appeared, PC manufacturers were terrified tablets would replace PCs (they didn't). When smart phones appeared, camera manufacturers were terrified they would replace actual cameras (they haven't).
When avocado toast appeared, everybody in their right minds said, "yuck."
Change--change causing extinction--used to take awhile:
- The first (steam-powered) automobile was built in 1769.
- The first production automobile with an internal combustion engine was built 116 years later (1885). A handful were built.
- 42 years after that, Ford had produced 1,000,000 Model Ts using the concept of the assembly line.
- By 1920 the number of automobiles in the US had eclipsed the number of horse-drawn buggies.
- Even so, in World War II (1939-1945), Germany and the Soviet Union employed 6 million horses for transport, mechanized transport being the exception rather than the rule.
Change got quicker:
- 1946: ENIAC (first general-purpose programmable electronic computer)
- 1968: First microprocessor
- 1975: Bill Gates and Paul Allen go to MITS in Albuquerque to demonstrate BASIC running on a microcomputer
- 1981: IBM PC announced
- 1989: Tim Berners-Lee invents world wide web so we have a place for cat pictures
- 1995: I'm sitting in the middle of nowhere (Eastern Washington state, desert and cattle ranches) in a diner. Booth behind me are two old guys wearing Carhartts, ball caps with fertilizer company logos, eating lunch. And I can hear them. And they are talking about Windows 95. That's when the lights went on for me. Computing, I realized, is now ubiquitous.
And quicker:
- 1994: First smartphone introduced (Simon Personal Communicator)
- 2007: iPhone introduced
- 2018: 36% of world population has one to watch cat videos.
Hey, John, are you rambling or should I care?
This is a blog series about Docker, although that might seem a reach so far. Let's bring it home.
If you're reading this and you're not an immediate family member, then I have to assume you have legacy code. And that code is for a desktop application built with VB6, PowerBuilder, or even .NET/Winforms. And that application is old, big, complex, with at least one database behind a lot of forms and business logic that--over time--has been sorted out. The app works, people use it, and it's a huge liability.
It's a liability because you've built a wonderful factory powered by steam and everyone else is using electricity. The people who work on steam power are getting older and older and are hard to find and don't work cheap anymore. And there's the daily risk of the damn boiler exploding, taking the whole mess with it. You could build a new electrified factory next door but it would bleed you dry and take forever. You could try to replace all the stuff in the existing factory but there are pipes running everywhere and valves and gauges and switches and signs that say "Never touch this!" and you don't know if trying will wreck everything.
Basically you are faced with an existential threat.
Ahoy!
Here's how to keep alive. This series of blog posts is going to take a steam-powered application (ok, VB6) and convert it to a modern web application with RESTful endpoints, an Angular 6 client UI, ASP.NET Core server components, and readable code. Then we're going to put our whole web app into a container--Docker for Windows--and build it and run it locally in the container. Finally we're going to push the container to Azure and run it from there.
This is like replacing the steam-powered factory with one using cold fusion, with all new machines. And it's going to be less risky, costly, and lengthy than any alternative.
Why you should care about Docker
Docker is the candle on the icing on the birthday cake. The cake? That's a modern web app, written in languages like C#, HTML, and TypeScript. The icing? Continuous integration, continuous deployment (CI/CD). These two alone are the (potentially) extinction-level changes sweeping contemporary software engineering. The meteor that wiped out Waterfall crashed a long time ago. Agile/scrum replaced it, and with that model came the need for better faster methods to build, test, and deploy. Web apps no longer depended on updates delivered via physical media or downloaded msi files; they could be slipstreamed into production systems at will. This created a new set of problems, challenges, and opportunities. It's the new growth rooted in the composting bodies of dead dinosaurs.
Docker just makes it a little easier. But we'll get to that later.
All aboard!
So let's do this thing. Many Bothans didn't die to bring you this information, but I spent more time than I'd like to admit--plus a little bit of my soul--figuring all this out and I'm determined to share it with someone. Fortunately I have colleagues smarter than me who were enormous help (talking to you, Mauricio).
So grab your favorite app, or use our sample code, and follow along as we take our magical mystery tour of desktop to Docker.