The Modern .NET Show

Episode 123 - Docker for .NET Devs With Carl Sargunar

Embedded Player

Episode 123 - Docker for .NET Devs With Carl Sargunar
The .NET Core Podcast

Episode 123 - Docker for .NET Devs With Carl Sargunar

Supporting The Show

If this episode was interesting or useful to you, please consider supporting the show with one of the above options.

Episode Summary

This episode features Carl Sargunar, a web developer who has been freelancing for nine years and specializes in the content management system Umbraco.

Sargunar noted that the barrier for entry for trying new technologies has been greatly reduced. It is now as easy as finding the right tutorial, YouTube video, or Sargunar’s own resources. Visual Studio Code is one of the nicest editors available, and developers can right-click on a project to add a container to it. We discuss how Docker can be used to create reproducible builds and have truly cross-platform code.

The .NET technology stack now runs on any operating system and architecture, including Arm, Raspberry Pi’s, and other IoT devices. Developers can dual boot to Linux or use a Mac machine, and can run their apps on a variety of devices and architectures. Umbraco embraced .NET Core and took on a full platform rewrite to migrate the entire code base from Framework to 3.1. .NET developers have the luxury of using any tool they are comfortable with, and they can run their apps on brand new CPU architectures like the M1 and M2 chips.

Docker makes it easy to try out new technologies without needing to buy expensive hardware or install Linux. GitHub Code Spaces and JetBrains Fleet allow developers to spin up an IDE in the cloud so that they do not need a powerful machine to develop applications. Containers can be shared with others so that they can work on the same project without needing to install the same software. Docker files are plain text files that describe the changes made to the environment, making troubleshooting much easier.

Carl recently ran a workshop at the Code Garden Conference, introducing people to containers. He explained how Docker containers can be used to quickly and easily spin up an application with multiple containers, such as a web server, a database server, and a small website running Blazer and an API. Docker Compose can be used to build and run the application with just one command, and containers can be used to abstract away the operating system and dependencies, making it easier to deploy applications.

Episode Transcription

Hello everyone and welcome to THE .NET Core Podcast. An award-winning podcast where we reach into the core of the .NET technology stack and, with the help of the .NET community, present you with the information that you need in order to grok the many moving parts of one of the biggest cross-platform, multi-application frameworks on the planet.

I am your host, Jamie “GaProgMan” Taylor. In this episode, I talked with Carl Sargunar about what a .NET developer actually is. The .NET stack has changed quite a lot in recent years, and it now requires a new set of skills and expertise… or does it?

Carl and I chatted about how with the creation of things like docker, you can abstract away most of the difficulty in getting orchestrated and set up, create reproducible builds, and even have truly cross platform code - something that Carl writes on his 64 bit, Intel-based, Windows machine can be copied over to my M2 based Mac Air and run with almost no changes; all thanks to the wonderful worlds of open source, containers, and orchestration.

But you don’t even need to know what these are. Carl and I talk about how you can get started using containers with almost no effort and without having to use the dreaded command line interface - making you effective and productive from the off.

So let’s sit back, open up a terminal, type in dotnew new podcast and let the show begin.

Jamie

So, Carl, it’s fantastic to be connected with you today. We’ve met in person a few times and-

Carl

We have.

Jamie

It’s brilliant to finally have you on the show. It’s been a while.

Carl

Yeah, appreciate it. Calendar conflicts have gotten the way, but I do appreciate finally being able to find a window that both of us can make. And, yeah, I’m very grateful to be on the show. Thank you, Jamie.

Jamie

Well, thank you, Carl. I will just say that life gets in the way-

Carl

It does.

Jamie

Or the great philosopher Dr. Ian Malcolm said, “life finds a way.”

That’s what we do.

Carl

We just watched that last week with the kids, that it was a big thing because I’ve been wanting to show the kids Jurassic Park for such a long time and they are just about old enough to actually appreciate it and they watched it for the first time and they weren’t scared at all. Whereas when I watched it at their age, I was terrified.

Jamie

I fully appreciate what you’re saying.

Carl

Yeah.

Jamie

I am still to this day, and I’m saying this publicly, I don’t care if people are going to make fun of me, but I am terrified of dinosaurs, especially the ones with a big teeth. They died 65 million years ago and I can’t do it. I can’t go into museums, I can’t go to prosthetic shows or whatever you call them where they have the animatronics and stuff. I just can’t do it.

Carl

It’s the power of storytelling, isn’t it? Like, it doesn’t matter how janky the special effects were. The power of storytelling with a really good story and the way it’s presented just really gets to you.

Jamie

Absolutely. Still related to I mean, it’s Steven Spielberg, right? I don’t think he’s ever actually made a bad film. But related to that, I’ve seen some wonderful behind the scenes footage of, like, the full sized Animatronic T-Rex that they built and, you know, the big scene with it where it trashes the car and night time and it’s raining. Well, I don’t know whether you know this, but the rain caused the servos in it to malfunction and it shivers.

Carl

Wow.

Jamie

Like, the behind the scenes footage, it’s there. It’s not real, but it’s shivering like it’s cold.

Carl

Dinosaur is cold. Oh, wow. Yeah, that’s some fourth wall, kind of uncanny Valley stuff happening over there.

Jamie

Absolutely.

Unfortunately, we didn’t come here to talk about a Jurassic Park.

Carl

Movies generally, besides being a developer, I’m also a massive movie fan. And movies, I think, again, sorry, just to take it back to movies, it’s about the storytelling for me. I just absolutely love them. I’m not as big a fan of series. I mean, they’re great. I’ll watch a series and enjoy it. But a movie is something completely different. It’s that whole experience and things. So, yeah, I can talk about movies all day, so we can talk about movies if we’d rather. But I think your audience might appreciate development a bit more.

Jamie

Of course. Yeah, that’s absolutely fine. You see, I’m creating more work for myself. Maybe I need a movie discussion podcast.

Carl

I would be there in a flash for that.

Jamie

Oh, my goodness.

Okay, so one of the things that we talked about when we were discussing this and I just want to set this and level set for people is that before we get onto the topic, I just want to quickly discuss why we came up with this topic and that’s we were saying in the pre-recording session that we did that .NET has sort of exploded over the last few years. And it used to be that a “serious .NET developer” would be Windows only, and they would use Windows on their Windows machines to do Windows stuff. And that’s no longer the case.

So just wanted to sort of level set for the people who are listening in. Because obviously, before we get onto the topic, we’ll properly introduce you in a moment. Carl, there are people doing .NET now who never lived in that world. So for those people, we’re about to go down memory lane, I think, and just explain to you how it used to be to the people absolutely haven’t made that jump yet, or don’t see a need to make that jump yet. We’ll maybe introduce some topics that they can maybe go away and learn a little bit more on the run time using Google, Bing, whatever such engine they want, right?

Carl

Absolutely. I hope that’s a bit for everyone out there. I’ve been a developer for a long time and I’m sure we’ll cover this in due course. But yeah, this topic is particularly a close one to my heart because just if you look outside of the sphere of .NET development, there is so much other development happening out there and it felt for a long time like .NET was this kind of massive enterprise, slow moving, archaic kind of tanker that doesn’t change often. It’s the same thing over and over again. It’s not responsive or reactive or agile and that really isn’t the world that we live in today any more and hasn’t been for a long time. So yeah, absolutely.

Jamie

So I guess before we get to that, let’s talk a little bit about you, Carl. Let’s do a brief introduction to you. Maybe you can tell the listeners a little bit about yourself and then we know who Carl is. Who’s this guy talking at me?

Carl

Absolutely.

I’m carl. Yeah, I’ve been a developer since I graduated from university. Actually, that’s not strictly true. I’ve been a developer since I got given a computer when I was in my kind of early teens by my dad and he brought a computer home from work one day, and I kind of see that as my start of my journey. So I’ve been a developer for a long time, but I’ve been doing it professionally since about 2004. So getting on for 20 years professionally now. I’ve been at this game a while.

These days I am a predominantly a web developer. I do a lot of work with a particular content management system called Umbraco, but I also do kind of straight up web work. But I’ve been freelancing for a few years now, pushing on for nine years actually. Gosh, that’s flown by. And I also do kind of other stuff with clouds and app development and Xamarin and now [.NET] MAUI coming into Things, which is their newest app development framework.

So yeah, just kind of as a freelancer, as a fellow freelancer, I hope I’m sure you appreciate we tend to do what needs to be done and I’ve always really enjoyed that challenge of just jumping into problems and helping people solve problems So that’s who I am. I’m a kind of freelancer for hire who will come and help you solve your problems and have been doing that for many years now.

Jamie

Yeah, 100%. I totally understand and appreciate that. I’ve been doing it myself, freelance, for a while now and yeah, you pick things up very quickly. I wouldn’t say - I’m wary of saying quicker than permanent people, but I guess because we’ve given more freedom to pick things up than we have, maybe again, maybe drive is not the right word, but we have this requirement to pick things up a lot faster than learning it on the job, and there’s nothing wrong with either side of it.

Carl

No, absolutely.

Jamie

It’s one of those skills you need to pick up, right, to be able to learn things very quickly.

Carl

Yeah, I personally, I think that this may just be something that if your character is suited towards it, then it’s the kind of thing that you really enjoy. And if your character isn’t suited towards that’s, fine. There are plenty of jobs out there that will suit you. You find the right thing that works for you. This just happens to be the thing that works for me. Nothing wrong with what I do, nothing wrong with what other people do. You do the thing that works for you.

At the same time yes, the number of projects I’ve been thrown in where I have no idea what the framework they’ve used in and go, okay, fine, let’s just try to go back to basics and let’s try and solve this from early principles and let’s try and kind of understand what the problem is over here. And you draw on your experience, you draw on things that you’ve tried before and things that have worked before and hopefully get to a happy solution. Not always, but that’s the way it rolls.

Jamie

Absolutely. And I feel like that, I suppose, comes into what we’re going to be talking about, and that is you and I were talking a while back about, “what is a .NET developer?” Because it means a whole bunch of different things to different people. Traditionally, like, if we go back maybe 10-15 years ago, a .NET developer would be someone who uses .NET Framework on Windows, maybe some jQuery, if you like.

Carl

Yeah, they never liked the web stuff in the early days. It was always kind of play with it as arms or length as opposed to actually embracing it fully. Certainly in my personal experience anyway.

I’ve spent many years in my career, in my early career especially, sat in a room with 20 other developers, all of us on identical Windows machines, all of us using MSDN licenses to look things up days before Stack Overflow, focusing only on Windows. Web was something that we did and moved slowly into, but even then a lot of the web stuff was done the Microsoft way.

And I think that old legacy of just doing things in Microsoft way, just doing things the .NET Framework way, just doing things the way that was prescribed might color a lot of people’s opinions about what .NET still is, because that’s what .NET was back in the day. But these days it is a very different kettle of fish. It’s a very different landscape. The framework is completely different for anyone who doesn’t know and has been under a rock for the last four or five years. .NET now runs on any operating system. It will run anywhere. It’ll run on Macs, Linux, any architecture. It will run on Arm, it will run on Raspberry Pi’s, it will run on IoT devices. There’s a .NET Framework that will run on ESP 32s microcontrollers and things like that.

.NET really is embracing so much out there, and it’s a very different landscape from what a traditional Windows focused, building Windows apps and deploying them through set up programs that you downloaded and installed, kind of thing. That world is a very different world.

Jamie

Absolutely. And I think you and I were discussing a talk that you gave last year. So in 2022, we were discussing a talk that you gave at Code Garden and DDD Southwest.

Carl

Yeah,

Jamie

I believe the talk was called Docker is a Gateway draw .NET Everywhere.

Carl

Yes, that talk came about from when I mentioned earlier that I work a lot with the Umbraco, content management system. You know, for a long time that was written on Framework that totally ran on Windows machines. But when .NET 3.1 launched, that was the first version that, Umbvraco, kind of embraced, and they basically took on a full on, full platform rewrite to migrate the entire code base from Framework to 3.1.

And early Alphas came out when .NET Core was released, back when your show was in fact, what kind of attracted me to start listening to your show, because that was the kind of time that I think you were kind of just kind of getting going. Yeah, being able to run the CMS that I’ve been developing with for the last kind of five years on a Raspberry Pi, kind of just flick the switch in my head going, “wow, this is really, really cool. What else can I do? Where else can I run this?” And being able to run it on a Linux machine and a virtual machine and HyperV on my own host, that was completely mind blowing.

So from there I went, “okay, well, if I can run it on that, there are these things called containers that everyone is talking about, can I run it on there?” And obviously, yes, I could. So, you know, I started experimenting. I started playing. I created my own little kind of mini cluster of Raspberry Pi’s at home and was able to run three different hosts, all running Docker, all running this content management system, all running SQL Server Azure - SQL Azure Edge, which is a version of SQL which runs on Arm, and run this entire system on a Raspbery Pi in the container on Linux. And it was super performant and it was really very different to the entire experience I had before, which was great.

And since then, I’ve kind of just wanted to kind of shout about it. So I’ve done. As I said, the talk at code Garden - which is the conference for Umbraco - I did a talk there, I did a talk at DDD Southwest, which is a Bristol-based .NET talk, which happened last June, and it’s happening again. Actually, by the time this podcast goes out, it might have already happened, but it happens in the summer every time, and I’ve done it at three or four other conferences and meetups, and I just kind of become an evangelist for talking about containers and running .NET code in other places. So very exciting stuff.

Jamie

It really is. The last few years have been a wonderful time to be a .NET developer because quite literally, you can do your development anywhere. Like we were discussing just before when we went live, I’m sitting at a Mac Air with an M2 chip. That’s a brand new CPU architecture. Admittedly, the M1 was brand, brand new, but this is an Arm chip that is a brand new CPU. It’s not intel based, it’s not x86 based, it’s not a Risen super duper GT, but it’s none of those things. And yet the day I bought it, got it home, opened it up, installed the .NET toolkit, and I could just run the .NET apps, right? That’s a brand new architecture that’s less than 18 months old.

Carl

Yeah, absolutely.

Jamie

I can run .NET on it, right? And that’s mad to me.

Carl

That was exactly the same feeling that I had when I launched that when I got the first Raspberry Pi up and SSHed onto it and connected it on Terminal. Ran a script that I downloaded from Microsoft site and then was able to do dotnet new, and then fire up a web project and then dotnet run, and run it and see it, and open up the port on my network, and connect to it from my desktop computer across my home network, to run an MVC site on a little tiny arm system that cost 35 quid. And I did some load testing and it was blazing fast. So this was a very different, very new and exciting world. And yeah, absolutely.

To the extent that a lot of .NET developers now are no longer using Windows as their main machine, I know you’re amongst their number, too. And I still do a lot of legacy development, so I still need to keep my Windows machine. But I also have I also dual boot to Linux. I don’t need to run Windows for my day to day work any more. I can run linux. And I also have a Mac machine myself. So I do, I can pick the tool that I feel like using for that particular day, and I’m not restricted any more. The whole choice is available to us.

Jamie

Absolutely. That’s the great thing about this. There’s something that Scott Hanselman says, and he said it specifically about some of the CLI tooling. About a year or a year and a half ago, there’s a video that he put out where he’s jumping around in the tooling and he goes, “here’s Windows Terminal, I’m doing .NET in here. Now I’m going to jump to notepad. Now I’m going to jump to Vim. Now I’m going to jump to Emacs. Now I’m going to jump to Visual Studio.” And he turned to the camera and says, “use what makes you happy,” and I love that that is now the target of: use whatever makes you happy.

And to the point that you raised there about a lot of .NET devs don’t actually run windows any more. It may actually surprise some people that listen into this, and it will definitely surprise some .NET people who haven’t been exposed to .NET Core, and then, as it’s been renamed, .NET. Yet a lot of the devs that I’ve spoken to on a personal basis at Microsoft don’t actually run Windows because they don’t need to any more.

Carl

No, absolutely.

I can remember when I first saw a conference, I can’t remember which conference it was, but there was a Microsoft conference when .NET Core was just being announced, and the speaker came up on stage and he had a MacBook, and that was like, “wow, there’s someone at a Microsoft conference, one of their primary main conference.” It was David Fowler, I think, who did it. David Fowler works on the framework himself, and yeah, he came up on stage with a MacBook, and that was like, wow, such a moment for me.

So, yeah, and I think to kind of come back loop back to kind of your earlier point, a lot of developers may not know that from the .NET side of things, and I think there are a lot of developers out there who know very little about .NET, who still kind of hold on to that slightly older, open opinion that .NET is only Windows and .NET is only one framework that runs and does one job and nothing else. So it’s not just the .NET developers who may not be ever aware that now we are part of this global community that can run anywhere and do anything. But there might be other[s] Go developers and PHP developers and Ruby and rail developers who still kind of hold on to older ideas that .NET doesn’t run in the same way that they can, which is hopefully that will change over time. The way we can help that change is by doing more cross pollination between our various ecosystems.

Jamie

Yeah, 100%.

One of the things that I find when I talk to a lot of - there’s sort of three different camps, I feel, of .NET developers, and wherever you sit, and you don’t have to just sit in one camp, wherever you sit in these camps is perfectly fine. I find that there are .NET people who are very excited, I don’t want to say evangelist, but very excited, like you or I. “Oh, cool, I can run it on my raspberry pi, I can run it on a fridge.” Pro tip for people who don’t know if you’re on Samsung hardware that has the Tizen logo on it, .NET is the officially supported programming platform for Tizen. So if you have a Tizen device, you can push your .NET app to that device, a fridge, a TV, whatever.

So there’s that side of things where people are very excited, they’re terribly excited about what’s happening. We want to tell everyone there’s people kind of in the middle who are yeah, “I know about the new .NETs, but I can’t use it yet because the project that I work on doesn’t allow me to.” And there are another third set of developers who are very much a case of I think you used the phrase head under a rock earlier on. And sometimes it is that, sometimes it’s just and we’ve talked about this on Tabs and Spaces, where it’s like: if you are a nine to five developer, you get in, you start developing at nine, you stop at five and you go home and do something else. Fantastic. That is perfectly fine that you are a developer. I’m not a gatekeeper, or rather I’m not trying to be a gatekeeper.

And what I find is traditionally the group of people that are in that third set and some of the people from the second set. So the people who maybe don’t know that .NET has gone across platform and the people who are, “I love it, but I can’t use it,” they don’t tend to know some of these things because they don’t get exposed to it. And I feel like that it’s perfectly.

Carl

Okay for people not to know absolutely, 100%. This isn’t a gatekeeping thing. I think this is one of those where the path is there ahead of you and if you choose to walk that path, that’s fantastic. Come on in, the water is lovely.

And one of the nicest things that I’ve been kind of talking about in my Docker and all my conference talks is that tools like Docker really make it easy to make that leap. You don’t need to install Linux, you don’t need to have an old machine, you don’t need to have a Mac. You don’t need to spend two grand to buy the latest shiny Apple hardware so that you can try this out yourself. You can download Docker for Windows right now on an up to date version of Windows 10 or Windows 11, and you can fire up your own container in Linux running a MongoDB instance, or a SQL instance on Linux, or a PHP server, or just a very basic Apache server and run .NET code on there to try it yourself.

You don’t need to do a lot of set up. You don’t need to spend money to do all this stuff. The barrier to entry, to trying these new things has really reduced it’s just down to finding the right information, finding a tutorial that you can follow, finding a YouTube video. There’s plenty out there. I’ve got a few out there myself. There really is very little reason stopping people to kind of go out there and discover what .NET can do and what it can run.

If you’re in that third camp, if you’ve never been exposed to it and you’re happy with it, or you’ve never had the opportunity professionally to kind of .NET work on other platforms. Some of my day to day work does fall into that. Some of the projects that I support are very legacy platforms and very legacy systems. That is part of my work. But it does mean that I spend some of my own time playing around with Docker and Linux and this kind of thing just to see what else is out there, see what other things that can be done.

Jamie

Yeah, absolutely. Like you said, you don’t have to leap over, right? You can, you can try it in a VM or with Docker on your machine and that’s what makes things like Docker wonderful. One of the things that I’ve actually found right, so I remember the early days of.NET Framework where if you installed more than one .NET, you’d run into trouble.

Carl

And every time a new version of Visual Studio came out and there was basically six months where you couldn’t write any new code because you had to slowly migrate the old version off and the new version on. Yeah

Jamie

Absolutely, absolutely. One of the things that .NET and Docker combined and separately - so you don’t have to do Docker stuff to do modern .NET and you don’t need to do modern .NET to Docker. They’re mutually exclusive. But one of the things that they both allow you to do is you can install different versions of stock and run different versions of side by side.

Carl

Absolutely.

Jamie

Which is wonderful. Right, so like on this machine I’m talking to you now, I think I’ve got .NET five. No, I think it’s .NET six because .NET five wasn’t supported by anyone. So .NET six and .NET seven.

But on my desktop I’ve got 2.1, 3.1, 5 point something, six point something, seven, and one of the latest version eight; and they’re all installed locally on the entire machine. And I can create a JSON file in the root of my source code or whatever that says. “Okay, .NET I’m supposed to be using version 2. So if you’ve got that, run it in that,” which is wonderfuly right? So you don’t even have to worry about those compatibility issues of running multiple things at the same time.

Carl

Yeah, absolutely. Just being able to know that you can run a global.json in a project repository and just target a specific version, that’s a really cool trick to know. Just knowing that despite how many versions of .NET you have running, you can just target one and not worry about it. That’s it. Everything you do with that repository and below it will be in that one version is really, really cool.

Jamie

It really is. And there’s another trick, one that I learned when I was messing around with Blazer during its sort of initial release. And that trick was I actually had Docker be my dev tools. So I had Docker installed and that would have like the latest preview bits of Blazer. And when I wanted to build and run the app, I would issue the docker build && docker run command, because everything’s running inside of Dockerland, it doesn’t touch any of the files on my computer. So when it came time to actually delete that, it was just a case of, “I’ll just delete that docker image.”

Carl

Absolutely. That isolation is fantastic.

I can remember in the early days where I have had a virtual machine where I was basically dedicated for my dev work, and I would have a separate machine for my personal and web browsing and things like that. Because I didn’t want to risk anything to my dev machine. Because any downtime there costs money, it costs time, it costs productivity, the resource that you’re there to do a job and you don’t want to have anything that gets in the way of that. Whereas now the tools all just talk to each other so much better. You don’t have to worry about having - I mean, I have the release versions of the IDE Visual Studio as well as preview versions side by side of my machine. No problems at all. They all just kind of work together and talk together really well.

And just kind of on that same point, they’re talking together and working together really well: these containers, these tools, they open up a whole new opportunities out there. You don’t necessarily need to know the product, the language that any project is written in to be able to be helpful and useful on that project. I could go and do something on Ruby on Rails. I know very little Ruby on Rails, but I could still write some .NET code, put it in a container that will call an API and do something and provide some service for a website that’s run of Ruby on Rails. And that is code that will run absolutely fine side by side in its own container, talking to the Ruby on Rails project, we’re no longer restricted to only working on .NET solutions and.NET projects as.net developers.

There is a whole literally the world is our oyster. Or to coin Terry Pratchett, the world is our lobster. You can go out there and work on any project you want to because now our tools will work alongside other tools quite easily, which is really, really exciting.

Jamie

I have to say. I love to the Pratchett reference. So thank you for that.

Carl

Absolutely. It’s got to be done.


A Request To You All

If you’re enjoying this show, would you mind sharing it with a colleague? Check your podcatcher for a link to show notes, which has an embedded player within it and a transcription and all that stuff, and share that link with them. I’d really appreciate it if you could indeed share the show.

But if you’d like other ways to support it, you could:

I would love it if you would share the show with a friend or colleague or leave a rating or review. The other options are completely up to you, and are not required at all to continue enjoying the show.

Anyway, let’s get back to it.


Jamie

You’re absolutely right. And it also means that so I haven’t had a huge amount of experience with this. I wonder if you have, but it doesn’t matter if you don’t, because there’s actually a way of building and running your applications using and to use the really old term, “a dumb terminal” or a low powered machine. Right. You talked earlier on about building and running on a Raspberry Pi, but I mean, like building and running your multistack application on something that’s low powered, like a Chromebook or something. Because there are things like Mac in Cloud for Xamarin and .NET MAUI. But also there are products like GitHub’s Code Spaces and JetBrains Fleet that use containers on the other side that you don’t see, where they essentially spin up an IDE in the Cloud. So you don’t even need a super duper powerful machine.

Carl

No, this is another great thing about it kind of lowering the barrier to entry. You can basically use the tools that you have available to you and still get access to really powerful compilers and runtimes. GitHub Code Spaces especially, where I think they recently announced at their last conference that they’re making it free for everyone for a certain amount of time every month. I’m not sure how many hours it is, but yeah, you can basically log on right now, and as long as the project is configured to be able to take advantage of it, then you can fire up a code space, run the library that you’re working with in a docker container on their server. And you can pause it, you can literally just freeze the status as it is, come back to it later and pick it up and carry on where you were. And you don’t need to run it on anything more complicated than whatever machine you have with you. You don’t need to have those expensive tools, which is great for anyone. Anyone can now just pick these things up and run it.

And it’s not just individuals, it’s great for teams as well because you can then now also share those containers with other people. So you don’t need to have that whole, “well, it works on my machine. Therefore, if we can’t get it working on your machine, you can’t work on this project.” I can fire up a container and anyone can jump into that and see it working there and just kind of carry on working with it, clone it and create copies of it and they just they just put files at the end of the day.

Jamie

Absolutely, 100%. I do remember a number of years ago I was working on a brand new project and it took me three days to get everything installed and configured.

Carl

Those memories, asolutely. I’ve had - most of my early jobs, the first week is getting your computer ready, installing the various tools and if you compiled the main repository by the end of that first week you were doing well. I’ve been in a position where I’ve been the person doing that, and I’ve been in a position where I’ve been hiring, and the people that I’ve hired have come in, and you spend the time with them, and it’s a huge, massive drain of resource, of time setting all these things up. Whereas now you don’t need any of that.

It’s been moving that way for a while because you could get virtual machines on cloud hosted platforms for a while, but now with containers it’s just that much easier because the difference between a container and a traditional virtual machine is with a virtual machine, you not only have to - well, what a virtual machine will essentially do is virtualize the hardware for you. You still need an operating system on top of it, you still need something to run your operating system, on top of which you build your platform, on top of which you run your code. So in a Windows sense, you need to install Windows, you might need to install IIS, you might need to install SQL Server.

But with containers, it’s not virtualizing the hardware, it’s actually virtualizing the operating system. So you don’t need to replicate that. I can basically run on a very, very lightweight container, my application, and the entire container might not be bigger than 60-70 megabytes, and that would be all my code and everything it needs to run. And that reduction in resource requirement means that ten people can use the same hardware, whereas previously it might be only one, or two or ten processors can use the same hardware. So it’s really becoming very easy to do this kind of thing now.

Jamie

Absolutely. And it’s also easy to share

Carl

Yeah.

Jamie

Because you could do all of the things we’re talking about with dock and containers with a virtual machine image. The problem with the virtual machine image is it’s a binary file that represents the same kind of thing - it’s not exactly the same - the same kind of thing, where it’s like it’s the operating system and all the libraries installed and all of the packages and all the tools and stuff, but it’s one massive multi gigabyte binary file. So you can’t easily share that. You can’t track the changes either. So if someone installs grabs the image, installs something else, then saves over that image that’s now changed. Whereas Docker files, the files that Docker uses are just plain text and they describe the changes.

Carl

Absolutely. And you can see you keep them in your source control in exactly the same way that you keep your code in control. So you’re describing your environment, you’re describing the tools that you’re using, you’re describing the versions of the libraries that you need, you’re describing your configuration and any changes: you can just view the history, you can go and see what changes are made to get to any of that, which makes troubleshooting so much easier.

Yeah, exactly. It’s so nice to be able to do this kind of thing now and still developing stuff the traditional way is great, but it does feel a little bit kind of clunky almost when you have to work on a legacy project, which I do from time to time still today. But even when I work on a legacy project, what I try and do is move the things that I can off onto containers. For example, I run multiple versions of SQL Server in containers because certain projects need specific versions of SQL Server, and I can have a container that I only spin up for a specific project and when I’m not working on this project, I just turn the container off. That resources - those system resources - are not being used when I’m not using that project. Which means, traditionally, where I might have had on my main machine, I might have had SQL Server installed and I might have 30 databases for the various projects that I’ve worked on. I now don’t need that. I can just have 30 different containers, but I only spin up the ones that I need and when I don’t need them, turn them off. They just sat there as files on the file system now.

Jamie

And that’s what’s great about these things, because hard drive space is cheap, right?

Carl

Yeah.

Jamie

And just having the files on your hard drive space just sitting there not being used is infinitely cheaper and better for the environment, I think, than having a dedicated server or a VM sitting somewhere, constantly running on the off chance that something will hit it with some kind of request.

Carl

Yeah, absolutely. These large machines that are used in servers, they take resources just to run, they take electricity and they run several hundred watts even in idle, doing nothing. So yeah, cumulatively, that all adds up. If you think about a company with a reasonable number of developers to host a virtual machine to serve that many developers; 50-60 developers maybe, would take quite a lot of power. Whereas if you all just had containers running on your local machines, or even containers running on hosts, if you’re not using them, just put them to sleep, put them to kind of hibernated state and save the files and it’s a lot better.

Jamie

So we’ve talked a whole bunch about Docker and its containers, right? Yeah, we did say earlier on, but just in case people missed it, “I don’t have to use Docker,” right?

Carl

No, Docker is just the Hoover of the container world. There are many containers out there and there’s an open container standard as well of which Docker containers are a part of them. But yeah, there are a whole other types of containers out there. I mean, Docker wasn’t even the first containers have been around since long before docker. I don’t know my container history as well as I’d like to, but I remember reading about kind of very early concepts of containers running in early versions of Linux as completely standalone isolated processes which basically could then be spun up and shut down in very similar ways that the containers are kind of isolated from each other. They have their own space, their own storage file systems.

There are a lot of concepts that you need to kind of think about when you start working with containers, but you don’t need to know all of them from day one. And I think that’s just to kind of move in a slightly different direction. If you read a lot about the stuff, it can be very daunting to think, “wow, do I need to learn Linux? Do I need to learn about the Linux file system and how to work in command lines?” Yeah, that kind of stuff is helpful to know, but you don’t need to know that stuff from day one. The Windows Docker desktop application is a GUI application. You can use the GUI to just run it inside run containers inside there, run test applications inside there. Absolutely, learning more about the Linux file system and Linux commands and how to navigate the file system is helpful but you will naturally pick that stuff up anyway.

I knew very little about this when I started the experimenting with Raspberry Pi’s a couple of years ago. Whereas now, just through kind of playing with them in my own spare time you learn a lot about this stuff just by being immersed in it and playing around with it and trying new things and failing a lot. The number of times that you try and learn something and just you spend the whole evening scratching your head going, “this isn’t working, I don’t understand why it’s not working.” And then more often than not to come back to the problem a couple of days later and, “oh yeah, that was it.”

The biggest one is usually for me, I’ve got the wrong line endings in my files because I’ve been working on my files and Windows and Windows has the carriage return line,feed line (CRLF) ending, whereas Linux files only use line feed (LF) as their line endings and that kind of thing that can throw you if you’re not immersed in this stuff every day. But playing around with it kind of helps you get over that barrier.

Jamie

Especially the line endings thing. Usually that’s not a huge problem because what’s interesting is Microsoft took the initiative to “fix” - hopefully you can hear the bunny quotes there - to fix line endings on Windows with Notepad and things like that. Regardless of where you fit on that spectrum of, “should it be CRLF character town line feed or should it just be line feed?” having files that don’t suddenly become invalid when you move across OSes is quite nice.

Carl

Yeah, absolutely. I mean, back in the early days that was a big problem. It’s much less of an issue now, but yeah, when I first started kind of working around with this stuff it threw me quite a lot. But now the tools that there are a lot of editors out there you can use people use whatever editor you’re comfortable with. But personally I think Visual Studio code is one of the nicest editors and IDEs. It’s not really, I wouldn’t call it a full IDE, it’s not a Visual Studio kind of heavyweight development environment. It is an editor. But it’s so powerful that there are so many fantastic extensions for it.

Wherever you fall on your tool of choice, whether you like to use Notepad, or whether you like to use full Visual Studio, or Visual Studio code - there are a lot of tools out there that you can use. Those are just the ones that I personally prefer. But I found that when you’re working with files and when you’re working on projects, Visual Studio is a really awesome IDE. It’s a really heavy weight tool for working with this stuff, but there are so many other editors out there: Sublime, VS Code, Notepad, notepad++ you use the tool that works for you.

Personally, I think VS Code, visual Studio code is one of the nicest code editors out there. It’s not a full IDE like Visual Studio, but there are so many useful tools, extensions that people have written to work with, docker with, containers with, Kubernetes to be able to connect to SQL Servers and my SQL Servers and various services out there. So and that makes it easier. You can-

Jamie

Use the tool that makes you happy?

Carl

Ok. That makes it easier. You can use the tool that you feel comfortable with, which is really useful.

Jamie

Yeah, for a while I walked away from the Windows version of Visual Studio, right? Not Visual Studio Code, the cross platform, but I mean the Windows version. And I came back to it for a project I worked on last year. And what I found was and some people would be listening along going, “that’s super obvious.” You can right click on a project and say, “hey, can you add a container to this?” And it will do all of the wiring up for you. And then you can hit F5 when your app in the container and hit a breakpoint and pause it and poke around. It’s amazing.

Carl

Brilliant.

Yeah. I think this is probably true of any development tool out there and any language, but if the developers who worked on this stuff, worked in .NET 5-10 years ago were able to see the tools that are just available freely, you know, you don’t need to pay to use Visual Studio, even. You don’t need to pay to use Vs Code. That’s a free thing. But a lot of people might not know that Visual Studio is also available free for community use. And if your company is a small company, I think under up to a million pound. I’m not sure what the license requirements are for Visual Studio, but anyone who’s learning it can certainly pick it up and use it for free.

And you’re not only restricted to those, I mean, JetBrains Rider is another fantastic idea that a lot of people have picked up, and that’s a paid one. That is one that you kind of have to pay a license fee for, but it works for a lot of people and a lot of people swear by it. Personally, I tend to be just vanilla Visual Studio, I haven’t yet gotten over the muscle memory because Visual Studio is something that I’ve been working with for such a long time that I just know where everything is in Visual Studio. And I haven’t quite made the switch ever to be able to use JetBrains fully yet, but it’s really good and it’s a fantastic tool.

Jamie

Totally. As an early adopter of JetBrains Rider, I can quite happily say to you that when you first install it, it says, “do you want to use the Visual Studio key map or do you want to use our key map?” So it makes it even easier that you can just go, “oh, cool, I’m coming from Visual Studio. Pretend your Visual Studio, please,” and then all of your keyboard shortcuts still work?

Carl

Yeah, I have it installed right now I’m looking at the icon of my machine. It’s just probably force of habit that every time I open up a project to work in, I just go into Visual Studio. What I probably need to do is just force myself to kind of cold turkey Visual Studio for a week and do nothing but JetBrains. Like just make myself work in JetBrains for a period of time and then it’ll pick it up. I know that if you use ReSharper, especially that JetBrains is a lot more performant than ReSharper on top of Visual Studio because you’re basically layering again, you’re layering one extension on top of the base IDE, whereas it’s just built into JetBrains.

Jamie

Yes. I will not say, because I said this before in an earlier episode of the podcast and one of the people from the Visual Studio team got in touch and went, “hey, that’s no longer the case.” I will not say that Visual Studio is single threaded any more because it’s not. But a number of years ago, because like you said, because if you install ReSharper on top of Visual Studio, ReSharper has to sit in that plug in architecture and that can slow it and Visual Studio.

But like you said, ReSharper is built into Rider. So if you’re interested in doing that, it’s already there. Right. And so if your company is big enough or if your company fits outside of the of the community licensing for Visual Studio, then it may be worth looking into Rider.

Carl

Yeah

Jamie

I think because they do a 14 day trial. I think it or is it a seven day trial? I forget which one. Please double check and go on the website for JetBrains to check. But they do offer a free trial. And I feel like it’s useful for developers to know that there are other tools available even if they’ve never used them because it gives you that chance to actually step out and say, “oh, well, I’ve heard of that, never used it, but I know that it exists and I know that it’s useful for this particular thing.” Right.

Carl

I guess this also comes back full circle to the point we were talking about earlier where it’s not just one language that you have to work in any more, it’s not just one tool you have to work in any more. And if you do happen to make the switch to use Rider, JetBrains also have tools and IDEs for a load of other languages out there which are really kind of industry leading in a lot of them. So that will be another reason to make it easier for us .NET developers to work with other platforms and other tools. You’re no longer restricted to just using the same tools, and the same platforms, and the same languages. You choose the tool that you’re comfortable with and you choose the IDE, the developer tool that you’re comfortable with, and you choose the one that’s the right for the project that you work on. And if you don’t get on with one, go find another one. There are other ones out there.

Jamie

Absolutely. At the end of the day, all you’re doing is moving plain text around in text files. If you want to use Notepad or the equivalent on your computer, you can totally do that. That’s not a problem. In fact, this is something I’ve brought up a few times - I can’t remember whether it was on this show or Tabs and Spaces, but when I did my CompSci degree for Programming 101, my lecturer was the infamous Rob Miles. He’s a wonderful chap and he’s a Microsoft MVP, pretty well known in certain circles of the .NET space. And what he used to do is he’d bring a laptop in, plug it into the overhead projector or whatever, and he’d bring up Notepad and he’d be like, “right, today we’re going to write a file parser in Notepad.” And I remember asking him at one point, “I know that Visual Studio exists because we use it in the labs. And I’m not trying to ask imperative why, but like, what’s the thinking behind why you use Notepad and this C# compiler?” if you’ve never used that from the command line. That’s a trip.

Carl

Oh yeah.

Jamie

csc.exe

Carl

Yes, absolutely. I remember using csc in very, very early days of getting CI/CD working and trying to kind of get automatic compilation of committed code working with PowerShell scripts, before this was such a ubiquitous thing. Sorry, carry on.

Jamie

No, it’s fine. And, yes, I asked him, “why are you doing specifically Notepad and the csc.exe instead of loading up Visual Studio?” And he said, “I feel that there’s knowledge and power in being able to not use the tools if you don’t need them.” And he said, “I’m teaching you C#. I’m not teaching you Visual Studio.” And he said, “there’s nothing wrong with the Visual Studio at all.” It’s just this was the early 2000s. Visual Studio was still really relatively new. If something broke in the middle of a lecture, you’d have to spend the next 40 minutes fixing it.

Carl

If the lecture is finished. Absolutely, yeah.

Jamie

Right. The lecture is over. You haven’t actually taken anything from it, whereas Notepad is guaranteed to work.

Carl

Just to kind of touch on that point about learning again: we learned .NET back in the day when a console application started with a whole lot of using statements and namespaces and public static main and a whole lot of other stuff where single line applications now with newer versions of .NET are a thing where you don’t need any of that decoration. You don’t need to learn, “what is a namespace? And why do I have to have these curly brackets around my code? Why can’t I just write the thing that I want to do? If all I want to write out is ‘Hello, World’” why do I have to put all this decoration around it?" So the changes that have come along with newer versions of the framework are a huge step to bringing new developers into this ecosystem, because that’s another kind of mental barrier that’s no longer there. But you don’t need to learn stuff that isn’t relevant for the thing that you’re trying to learn. You just need to do if I just want to write out “Hello, World” onto the console application, I just write out “Hello, World,” and bang, there it is. Which is really cool.

Jamie

Oh, absolutely. And like you said, it reduces that barrier to entry, which effectively gets rid of any gatekeepers that were there. I’ve never witnessed any, so I can’t say whether there are gatekeepers or not, but it gets rid of those gatekeepers who say, “you need a super powerful computer, you need Visual Studio, which you have to pay for, by the way, and you need these tools and you need this and you need that. And now that you’ve gotten all of those things, you can now start learning.” Whereas actually, the learning part is the hard bit.

Carl

Yes.

Jamie

Like I said with Rob Miles, if you’ve got a tool that only works sometimes, all causes weird esoteric errors that you don’t understand yet, because you’re not at that point in your journey with a programming language, then you’re going to give up. Right. I remember back at college, so it had been about 17 years old - so for the international Audience College in the UK, 16 to 17, and then you might go to university afterwards. I remember back at college, we were doing some C++ stuff, and in order to use the IDE that was chosen for this course, you had to drop out of Windows because it was a DOS 3.1 program.

Carl

Oh gosh, yeah.

Jamie

And when things go wrong in Dos, they go wrong.

Carl

They go very wrong. Absolutely.

To circle around to containers again, that’s another great reason to use containers in your code where you can because when you compile an image into containers, when you compile your code into an image that is repeatable, that image is there, that process is the same. And wherever you run it, you know you’re running the same code, you know you’re running the same process, so you no longer have that. “well, it’ll work in this machine because this has the libraries installed.” The image will already have everything that it needs to run. It will already have all the references to libraries. It will already have the services it needs baked right into it. So wherever you choose to run that, it just works. It just works.

Jamie

Absolutely.

Carl

I wish I get more opportunity to work with containers in my day to day work. I don’t, unfortunately. But every opportunity outside of that I get, I take it because they are such a cool tool.

Jamie

Absolutely. And the thing that I find wonderful about container work is you could build a container on your machine using a docker file, right? And a docker file. We’ve breezed over this, but it is quite literally just a list of plain text steps for docker to do. “Install this, install that, now pull this code, now run this command, and now serve the app.” It’s not exactly that, but that’s what it boils down to, right?

Carl

Essentially, absolutely.

Jamie

You could build a docker image on your machine, send me the docker file, and as long as I have all of the source code that you are compiling and running with that docker file, I can run it on my machine. You’re sitting behind a machine that is you said yourself you’re dual booting Linux and Windows on x86/x64 hardware, intel or AMD. You can send that file to me. I can run docker run on that file or docker build && docker run.

Carl

Yeah

Jamie

On my Mac M2. And it runs exactly the same.

Carl

Yeah. I mean, this is exactly the thing that I relied on. I mean, last year I ran a workshop at the Code Garden Conference from Umbraco where I introduced a whole lot of people. We had about 70-80 people turn up both in person and online who had never used containers before. And altogether over the space of 2 hours, we cloned a repository down. We started the project, we created docker files, and we were all able to basically get to the point where we were able to run this site on a container on our machines, but in the same repository - and it’s on my GitHub. If anyone wants to find out the link, I’m happy to tweet it out later. But you can clone this down. There’s also a completely finished repository there where you don’t even need to do any of the actual kind of setup yourself. You just clone the repository and you run something called docker-compose, which basically will not just run one container, but Compose lets you kind of create an application with multiple containers. And it will spin up a web server, a database server, a small website that’s running Blazor, and a small website that’s running an API, and fire them all up. And you can just go docker-compose up. It will build all of it and it will run it for you. And then you can just open up a browser and run it, which is really cool.

Jamie

It is. It’s marvelous. But yeah.

So gone are the days of I remember, “oh, we’ve got this new app that we’ve built. We better talk to Ops about them buying a server and finding the budget to buy a server and then getting them the budget to install the correct operating system with the right licenses, then installing the security systems, then setting up all of the network hardware to wire it all up so it sits nicely behind our firewall. And then maybe in two weeks time, we’re ready to deploy and then we can point out the outside world and have a DNS entry pointing to that server where the app will eventually be running.” Right. Whereas you were saying you just do a docker-compose up, hit return, and it spins all of that infrastructure up on your machine.

Carl

Yeah, it’s really cool. That’s the biggest takeaway for me from this conversation. I know we’ve kind of rambled a little bit and moved from various points, but for me it really is a gateway to learning and being able to do all this stuff anywhere. It’s almost democratized being able to do development because you don’t need a huge amount of resources, you don’t need a huge amount of tools, you don’t need infrastructure. It just makes things accessible and easy. And there are so many projects out there that will help people learn this stuff and so much documentation and instructional videos. So it’s a really cool time to be a developer.

Jamie

Oh, absolutely. I feel like you were saying earlier on, there will be parts of apps that you are working on where you may be able to strip parts out and put them inside of containers, which then kind of future proofs them a little bit as well. Because like you said, you’re abstracting away the operating system, you’re abstracting away the dependencies. You just have the source code and a text file that describes the “perfect” infrastructure for it to sit on.

Carl

Absolutely. It’s a very basic things, but it works so well and it works in a repeatable fashion. It’s great.

Jamie

Excellent. Well, what I’ll say, Carl, is thank you ever so much for talking with us. I know that outside of the recording, because our editor Mark does a wonderful job at this. I’ve kept you for way too long and you’ve got people saying, “hey, Carl, why don’t you come check this out?” So what I will say, Colin, thank you ever so much for talking with us, putting up with me for sure.

Carl

Thank you for taking the time to have me on the show. It’s a really fun conversation. I’m happy to talk about this stuff to anyone. So, you know, if you ever find me in the real world or on social media, just if you ever want to chat about containers and stuff, always happy to do so. And I’d also apologize to your editor because I know that we’ve had a few interruptions throughout this recording.

Jamie

Hey, that’s fine. It’s okay. Those things happen, right? Just quickly, before. We sign off then. Carl, where can people go to find out more about you? I mean, I know that we initially got connected on Twitter. Are you still a Twitter user or has Mastodon claimed you?

Carl

I haven’t yet made the switch over to Mastodon, but I’ve certainly probably reduced how much I’m on Twitter, but I am still on Twitter. That’s probably still the best way of getting a hold of me. I also have a blog which I can put in the show notes, so don’t worry about writing stuff down now. Yeah, Twitter is probably the best place to get a hold of me right now, so I’m not yet on Mastadon. If Twitter goes downhill much more, I might switch over, but for now, I’m still on Twitter.

Jamie

Cool, excellent. Well, what I’ll do is I’ll collect all of those links from you and make sure that they go into the Show Notes for sure. And like I said, cool. It’s been a real pleasure chatting with you today. Hopefully we can do another one in person.

Carl

I would really love that.

Jamie

Yeah, excellent.

Carl

That’d be great.

Jamie

Excellent. Well, like I said, thank you ever so much.

Carl

Okay, thanks, Jamie, and speak to you soon.

Wrapping Up

That was my interview with Carl Sargunar. Be sure to check out the show notes for a bunch of links to some of the stuff that we covered, and full transcription of the interview. The show notes, as always, can be found at .NETcore.show, and there will be a link directly to them in your podcatcher.

And don’t forget to spread the word, leave a rating or review on your podcatcher of choice - head over to .NETcore.show/review for ways to do that - reach out via out contact page, and to come back next time for more .NET goodness.

I will see you again real soon. See you later folks.

Follow the show

You can find the show on any of these places