ASP.Net 5 on Docker: Now with Release Candidate 1
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Title of Series | ||
Number of Parts | 133 | |
Author | ||
License | CC Attribution - NonCommercial - ShareAlike 3.0 Unported: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this | |
Identifiers | 10.5446/48839 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
00:00
WeightApplication service providerSoftware developerRun time (program lifecycle phase)Core dumpFluxApplication service providerOpen sourcePhysical systemMobile appCore dumpPoint (geometry)Software frameworkWeb 2.0Run time (program lifecycle phase)WindowComputing platform2 (number)WeightForm (programming)WebsiteData centerTouchscreenWeb applicationServer (computing)NumberBitMultiplication signHydraulic jumpDemo (music)MathematicsMoment (mathematics)Stability theoryGame controllerAxiom of choiceOcean currentRevision controlCartesian coordinate systemComputer configurationProjective planeLibrary (computing)ThumbnailDoubling the cubeComputer networkObject (grammar)SequelSystem call.NET FrameworkQuicksortScripting languageLattice (order)Medical imagingProcess (computing)Expert systemReplication (computing)Computer animation
06:57
Software developerElectronic mailing listMaxima and minimaWebsiteRootElectronic meeting systemComputer networkRight angleCartesian coordinate systemApplication service providerSoftware developerIntegrated development environmentWeb applicationDampingAssembly languageCodeVisualization (computer graphics)CompilerWeightOpen sourceComputer virusWindowProper mapCross-platformWebsiteASCIIComputer fileElement (mathematics)Projective planeSystem callAsynchronous Transfer ModeCore dumpFilm editingGreatest elementSemiconductor memoryDemo (music)Limit (category theory)AuthorizationCompilation albumRadical (chemistry)Web 2.0Computer animation
10:33
Software developerDrag (physics)WeightApplication service providerFluxCore dumpLattice (order)SynchronizationWeb browserWindowRadical (chemistry)Cartesian coordinate systemWebsiteApplication service providerCodeSystem callVisualization (computer graphics)Text editorDot productNoise (electronics)Computer animation
11:33
Software developerEmpennageVideo game consoleComputer fileDemonVisualization (computer graphics)Text editorCartesian coordinate systemFunctional (mathematics)Entire functionComputer fileBitGame controller2 (number)Zoom lensConfiguration spaceScaling (geometry)DatabaseCache (computing)Shift operatorWeb 2.0View (database)Computer fontGoodness of fitProjective planeGraphical user interfaceComa BerenicesUser interfaceModal logicQuicksortProduct (business)Observational studyCodeSource code
13:07
Software developerVirtual realityComputer-generated imageryComputer fontComputer fileDemonVideo game consoleProgrammable read-only memoryDefault (computer science)Virtual machineOperating systemMedical imagingBlogComplete metric spacePlug-in (computing)Line (geometry)WordCuboid1 (number)CASE <Informatik>Application service providerLevel (video gaming)Demo (music)FingerprintProcess (computing)DampingProjective planeSemiconductor memoryFile systemArmDistribution (mathematics)Different (Kate Ryan album)Configuration spaceEntire functionBitPoint (geometry)Computer fileSurvival analysisException handlingWeb 2.0Turtle graphicsPhysical system2 (number)AirfoilCartesian coordinate system
17:56
Software developerComputer fileExecution unitExtension (kinesiology)Local ringContext awarenessComputer configurationLine (geometry)Cartesian coordinate systemTouchscreenCuboidServer (computing)Medical imagingWindowRadical (chemistry)Different (Kate Ryan album)IP addressProjective planeLocal ringComputer fileUniform resource locatorBuildingLimit (category theory)Address spaceRow (database)Parameter (computer programming)System callPower (physics)Virtual machineGastropod shellSource code
20:33
Software developerBeta functionMenu (computing)Execution unitMassPhysicsRun time (program lifecycle phase)CurvatureChi-squared distributionReflection (mathematics)OvalMedical imagingRun time (program lifecycle phase)Physical systemInternetworkingExtension (kinesiology)MathematicsCartesian coordinate systemEntire functionType theorySoftware frameworkProjective planeMereologyComputer filePoint (geometry)Primitive (album)Execution unitSource code
22:50
Process capability indexCone penetration testSoftware developerSoftware testingComputer fileComputer virusFingerprintConvex hullCurvatureLimit (category theory)Information securityStress (mechanics)UsabilityBeta functionCAN busSheaf (mathematics)Projective planeCore dumpComplete metric spaceSoftware frameworkComputer networkWindowSystem callMoment (mathematics).NET FrameworkTranslation (relic)Point (geometry)WritingInstallation artMedical imagingMereologyPhysical systemInternetworkingSet (mathematics)Key (cryptography)Line (geometry)Right angleOvalSource code
25:48
Computer fileSoftware developerProgrammable read-only memoryMaxima and minimaBeta functionHill differential equationVariety (linguistics)RootComputer-generated imageryApplication service providerWeightMereologySelf-organizationSet (mathematics)Line (geometry)Application service providerMedical imagingWindows RegistryComputer fileDemo (music)Projective planeNumber.NET FrameworkRevision controlComputer networkPoint (geometry)Slide ruleOperator (mathematics)NamespaceComa BerenicesSource code
27:49
Software developerWeightApplication service providerComputer-generated imageryFlash memoryComa BerenicesGoodness of fitMedical imagingLaptopBefehlsprozessorRoundness (object)QuicksortComputer animation
28:52
Software developerLink (knot theory)Computer fileMedical imagingWeb pagePoint (geometry)Virtual machineBitCASE <Informatik>Zoom lensRevision controlKernel (computing)Real numberComputer animation
30:08
Computer-generated imageryWeightApplication service providerSoftware developerIcosahedronPay televisionMedical imagingData managementSpacetimePoint (geometry)Computer animation
31:01
Software developerCase moddingLocal ringRadical (chemistry)Medical imagingBridging (networking)Standard errorFunction (mathematics)Keyboard shortcutStandard deviationProcess (computing)Game controllerCartesian coordinate systemSource code
32:15
Computer virusSoftware developerComputer-generated imageryApplication service providerWeightComputer fileDesign of experimentsLocal ringGame controllerCartesian coordinate systemAddress spaceRight angleMultiplication signProcess (computing)WebsiteDirectory serviceMedical imagingMobile appLine (geometry)Projective planeComputer animationSource code
33:38
Computer-generated imageryWeightApplication service providerSoftware developerMiniDiscModul <Datentyp>Euclidean vectorDirectory serviceWindows RegistryPhysical systemMedical imagingUniform resource locatorRevision controlDefault (computer science)MereologyComputer fileProjective planeMoment (mathematics)SpacetimeCartesian coordinate systemMultiplication signPoint cloudQuicksortBitFunction (mathematics)System callApplication service providerLine (geometry)Electronic program guideCore dumpModule (mathematics)RootComputer animation
36:14
Core dumpComputer fileComputer virusDesign of experimentsSoftware developerGodSoftware testingWindows RegistryIEC-BusFingerprintWorkstation <Musikinstrument>Proxy serverSpacetimeExecution unitContext awarenessHardy spacePoint cloudMedical imagingFunction (mathematics)Repository (publishing)Point (geometry)Projective planeSoftware repositoryComputer fileBuildingRight angleSource code
38:07
Software developerContext awarenessRepository (publishing)WeightInflection pointRight angleWebsiteMedical imagingSign (mathematics)Multiplication signPoint (geometry)Virtual machineGoodness of fitVideo gameCache (computing)Computer animationSource codeJSON
39:20
Software developerWeightComputer-generated imageryTotal S.A.Axonometric projectionHacker (term)Application service providerProcess (computing)Escape characterRevision controlWeb pageVolume (thermodynamics)Rule of inferenceProjective planeWeb browserCodeMultiplication signDataflowDirectory serviceComputer fileVariable (mathematics)MathematicsMedical imagingGoogle ChromePresentation of a groupInternetworkingBitComputer-assisted translationIntegrated development environmentClosed setGraphical user interfaceInstallation artPlastikkarteCartesian coordinate systemWater vaporDirect numerical simulationComputer networkPoint (geometry)Asynchronous Transfer ModeVideo gameNoise (electronics)Source code
43:49
Hill differential equationSoftware developerComputer virusTotal S.A.Demo (music)Execution unitRevision controlSicAxonometric projectionDirected graphRaster graphicsElectronic meeting systemException handlingMathematical optimizationStack (abstract data type)Wrapper (data mining)Extension (kinesiology)WeightPrice indexDemo (music)Right angleCartesian coordinate systemAreaRoundness (object)WindowComputer networkMereologyStack (abstract data type)Physical systemCategory of beingComputer animationJSON
45:55
Software developerRootWeightApplication service providerExistential quantificationMobile appCodeGoodness of fitCartesian coordinate systemVolume (thermodynamics)MathematicsParameter (computer programming)AirfoilFilm editingOnline helpGame controllerType theorySource code
47:37
Software developerVideo gameVisual systemBuildingMIDIMobile appInternet service providerGraphical user interfaceApplication service providerMobile appCartesian coordinate systemMathematicsProjective planeDomain nameCategory of beingQueue (abstract data type)Medical imagingMultiplication signDatabaseBitVariable (mathematics)Different (Kate Ryan album)Virtual machineTable (information)Goodness of fitComputer fileSet (mathematics)Java appletEvent horizonMessage passingIntegrated development environmentTerm (mathematics)Bus (computing)Software developerNetwork socketAcoustic shadowDemonMoment (mathematics)Keyboard shortcutWindowFront and back endsProcess (computing)Core dumpInternet service providerRight angleLaptopWeightData centerLink (knot theory)Point (geometry)QuicksortMultiplicationOperating systemAuthenticationSlide ruleEmailAreaGastropod shellCuboidAnalytic setScripting languageOrder (biology)Sound effectWritingData storage deviceComputer networkSystem callAirfoilExecution unitTotal S.A.FingerprintPhysical lawBuildingInheritance (object-oriented programming)Natural languageVolume (thermodynamics)Point cloudComa BerenicesArmMetreIntelligent NetworkBit rateSource codeComputer animationLecture/Conference
56:39
Application service providerSoftware developerComputer iconWeightProxy serverGraph coloringMultiplication signParameter (computer programming)Function (mathematics)Different (Kate Ryan album)Proxy serverWeb browserType theoryGame controller
57:30
Internet service providerSoftware developerMaxima and minimaCone penetration test9K33 OsaComputer-generated imageryProxy serverPrice indexPhysical systemWeightUtility softwareGame controllerType theoryMultiplication signMedical imagingRight angleMoment (mathematics)Goodness of fitPoint (geometry)BitComputer animation
58:36
Software developerGraphical user interfaceDemo (music)Game controllerRight angleBuildingComputer animationSource code
59:35
Software developerEmpennageSlide ruleExtension (kinesiology)IP addressPoint cloudProxy serverVariable (mathematics)Multiplication signProjective planeSoftware testingLink (knot theory)Medical imagingIntegrated development environmentVolume (thermodynamics)AirfoilBitSheaf (mathematics)Direct numerical simulationSystem callVirtualizationInformation
01:01:21
Software developerExtension (kinesiology)Price indexInstallation artProcess (computing)Beta functionRootCurvatureInternet service providerBitUniform resource locatorCodeDirect numerical simulationProjective planeComputer animation
01:02:14
Software developerComputer fileProcess (computing)VarianceLine (geometry)Game controllerWeb pageWeightCartesian coordinate systemElectronic mailing listInternet service providerPoint (geometry)Computer animation
01:03:16
Software developerComputer fileDemo (music)WebsiteContent (media)Link (knot theory)DatabaseData managementInternet service providerEntire functionForcing (mathematics)Game controllerDenial-of-service attackCartesian coordinate systemComputer animation
01:04:13
Software developerVisualization (computer graphics)Virtual machineApplication service providerMedical imagingCodeComputer fileMoment (mathematics)Multiplication signCategory of beingString (computer science)LaptopInterpolationBitDirectory serviceCartesian coordinate systemPoint (geometry)Multi-core processorPoint cloudRight angleInternet service providerSystem callWindow
01:06:09
Software developerCodeMultiplication signInternet service providerConnected spaceTwitterSystem callInternetworkingPlastikkarteEmail
Transcript: English(auto-generated)
00:05
Hello, and welcome to all of the people who don't care about immutability in C-Sharp. Thank you for coming. So, yes, we're going to talk about something that's actually useful. If you want immutability, use F-Sharp.
00:22
There you go. That's that talk done. Summarise that for you. Hi. Yeah, we're talking about ASP.NET 5 on Docker, and I've been doing this. I have been building this thing for the last year, which is I've taken a monolithic ASP.NET,
00:42
Windows, .NET Framework, MVC 5, Web API 2 application that has been running in Azure on, when I put it up, it was called Azure websites. They've completely changed the branding and everything, but the site's still running. But, yes, it's a single, big monolithic application, and it runs in Azure websites.
01:05
And I have, and it runs in every Azure data center in the world. And that is a number that gets bigger. Every month, Microsoft open a new data center. They just opened three in India. They're opening one in Canada soon. There's actually going to be one here in the UK,
01:22
so that the banks and the government can put their data in it without worrying about it. So, yes, it's getting expensive. And I have been looking for ways to try and keep my costs down, and I looked at the prices of the various hosting options inside Azure,
01:41
and it turns out that when you use Azure web apps, it's fantastic. It is a really, really good platform, and I love it, but you pay for it. And actually what you pay, a single small VM, which is a single core,
02:01
and 1.5 gigs of RAM, I think, on Azure web apps, costs double what the same size VM costs just running Linux. And so I thought, can I get this to run on Linux? And then ASP.NET 5 came along, and so that was great,
02:21
but I wanted the same experience running my app and deploying my app and managing it and supporting it and monitoring it and everything. I wanted the same experience with Linux VMs that I was getting with Azure web apps. And at the same time, my side job, which is the thing that actually pays my rent,
02:43
and school fees and things like that, we've been doing a lot of stuff with Docker and Node and some .NET and all this other stuff. And so I started learning about Docker, and I thought, this sounds great. I can use Docker and some of these orchestration systems and so forth to do what I'm doing now, but do it on Linux
03:04
and with more control over it, and I can halve my hosting costs. And when your hosting costs are over 1,000 pounds a month, halving them is actually quite a worthwhile activity, particularly when you're hoping to scale up any time soon.
03:20
So the first thing that you have to mention is that Docker obviously is a Linux platform at the moment. Windows is going to support it. We're getting Windows Server 2016 nano images, and you'll be able to run Windows containers on a Windows platform.
03:41
But for the time being, we have ASP.NET on Linux. And this works, and it's worked to some extent for over a year now, and it's just getting to the point now where it's actually reasonably stable. It's actually supported. Microsoft, despite it all being open source and on GitHub, Microsoft have now said, it's got a Go Live license,
04:01
and you're kind of going, cool, I'll stop worrying about the fact that I've been live on it for the last nine months. But yes, we can run ASP.NET on Linux, and we have a choice of run times. We can either run on .NET Core, and we can run on mono 4 point something.
04:20
Current stable version of mono, I think, is 4.2. And Core is unstable, and the problem is that there are a lot of moving parts with .NET Core and with ASP.NET 5,
04:41
not least of which is the name. It started out as K, then it was DNX, now it's ASP.NET 5. Possibly more changes coming, I don't know. But the Core stuff has been a real problem. They've basically had to take the CLR and extract as much as possible from that,
05:01
but then write a Linux kind of layer for it and a Darwin layer for the Macs and make it work on Windows at the same time. So that's been challenging. And they've also taken the entire .NET Framework, ripped out the bits that are Windows specific, like WPF and Windows Forms and System.Web and anything to do with IIS.
05:22
And what's left is called the Core Framework, and that's on GitHub. And we've got the command line tooling as well. And at the moment, the command line tools on Linux and on Mac don't work if you're using the Core runtime. You have to be using the mono runtime
05:40
even though when you launch your application, it can be running on Core. And the other thing is that when you port a framework from one system to the other, you kind of start with System.Object, and then you implement System.Void and System.String and System.Int32,
06:01
and you gradually work your way up, which means that things like System.Data and System.NET.HTTP are the last things that get done, which means that the rest of the ecosystem that's out there, people who do things like the PostgreSQL ADO.NET libraries or anything that runs on top of HTTP,
06:22
have been sat there twiddling their thumbs, waiting for Microsoft to catch up to this point where they can start migrating their project. And that's just started happening. So for most of the demos I'm doing today, I'm going to be using mono just because I don't want to get bitten by something not working.
06:41
But pretty soon we'll be able to use Core all over the place, and that will be very nice. So yes, well hang on, before I jump into doing the Docker stuff, let's just, we'll jump across to a different screen. That's the doctor's name in the original Gallifreyan script,
07:05
because, yeah, why wouldn't it be? Okay, so. Let's just cd, and we'll cd into talk-sash-ndc-asp-net. Right, and I'm going to, hello.
07:23
Right. So, you're all .NET developers. You're all Visual Studio guys, yeah? Visual Studio 2013, maybe 2015, maybe 2010 if you work at one of those places. If you do, then someone will give you a hug. I'm not a tactile person myself, but we can make you feel better.
07:42
But no, this is Linux. This is Arch Linux, it's proper hardcore Linux, although it's running the Cinnamon desktop, which is the most like Windows you can get. But we don't have Visual Studio. And we have Visual Studio code, but despite having the VS moniker on it, it is a text editor, it's not an IDE.
08:02
There is an IDE coming. JetBrains announced yesterday, Rider, it's actually a full-blown cross-platform IDE based on IntelliJ, but with ReSharper running in a separate process, and then IntelliJ talks to ReSharper across just IPC.
08:21
And it's going to be awesome. And I said, haddy, can I have it for my demo thing? And he said, no, because I don't trust you to delete it afterwards. Which is completely reasonable, because I wouldn't have done. Why would you? So yes, anyway, we're going to be using VS code today. VS code doesn't have that file new project,
08:41
and wizards and stuff, and it doesn't need it, because we're Linux, and we're Mac guys, and we use the command line, and we're hardcore, and we don't need wizards. We can do everything from scratch. So we do everything from scratch. So we go, yo, ASP net. And then this happens, eventually, come on. There we go. Yes.
09:02
It's not a wizard, it's ASCII. Don't call it a wizard. So I choose web application basic without membership and authorization, and I hit enter. And what do you want to call it? I'm going to call it hello NDC. And then look, it's gone and created a whole bunch of stuff,
09:22
and it's given me lovely instructions for what I need to do next down at the bottom there. So that's Yeoman, which is basically a multipurpose scaffolding project. You install Yeoman, it's a node application, node package, and then you install a generator in generator-asp-net, which is done by Microsoft,
09:40
and then it basically gives you a wizard that you can pretend isn't a wizard, because you're using it from the command line. So let's do what it says here. We'll cd into hello NDC, and we'll do a Danu restore, like this. Hopefully that's going to get everything from the cache, because otherwise it could take a while.
10:01
There we go. And then we're not going to do the Danu build, because you don't build ASP.NET 5 applications. You just push the code, and you run them. And nobody say, oh, so it's like websites in Visual Studio 2003, because it's not. It's completely different for some reason. And then we just say dnx-web, okay?
10:23
And then that will spin up, and that's used the Roslin open source C Sharp compiler to compile all my code into in-memory assemblies. And then we're going to go back over to here, get rid of the terminal window. I'm going to go to a new tab here.
10:42
I'm going to go local host 5000. And there you go. That is a brand-new ASP.NET application created with, don't call it a wizard, running on Linux. And you can sort of tell. It looks exactly like a Microsoft starter website. Okay?
11:00
So that works. That's nice and easy. And then we can jump into the code for that, just by, so let's stop that. And we'll just go code dot. And that's going to open the Visual Studio code editor. And that's on my monitor, and you can't see it.
11:22
So there. No, let's put it over here so you can. And we'll maximize that. If I can, there we go. And one thing I do like about Visual Studio code, it's a HTML, CSS, JavaScript application
11:40
running inside the Electron shell. Same thing that Atom runs in. But basically, because it's inside there, they just, it's Chrome, effectively, and they've just left Chrome's zoom functionality switched on. So you know in like Sublime Text or Visual Studio, when you press control plus, it makes the editor font bigger.
12:00
But for us as presenters, that's not hugely helpful when you're trying to show something in Solution Explorer. Code, on the other hand, just scales the entire user interface, which I think is awesome. So yes, and you can see here, we've got various bits and pieces in here. We've got our project dot JSON. This replaces the CS Proj files.
12:21
And we've got our startup, which basically replaces web dot config and IIS and the integrated pipeline and a whole bunch of good stuff. And the rest of it, controllers and views all look pretty much the same. Okay. And then the other thing you notice is there's a Docker file in here. And that's generated by the wizard as well.
12:43
Because obviously, if you're doing this on Linux, you're gonna want to run it in Docker. And actually, that is true these days. People in Linux deploying anything, pushing anything into production, you pretty much just run it in Docker unless it's like a database or a cache or something like that.
13:00
Okay. So, let's talk about Docker briefly. Control shift tab, there we go. So, has anyone done anything with Docker with like Node or Ruby or Python or Go or any of those sorts of things? Or are you all complete Docker newbies? Mostly Docker newbies?
13:20
Yes. Anyone's arms work? No? Anyone paralyzed from the neck down? I said that once and somebody was. Don't laugh at that. It was terrible. I felt awful for seconds. So, yes, Docker, the thing is,
13:41
it's not very small virtual machines, but the easiest way to think of it is as very small virtual machines. So, the difference is that a virtual machine spins up an entire operating system and gets a chunk of memory assigned to it and it never lets go. A Docker container is a process that's running on your operating system.
14:02
So, it's just a process, except it's got kind of fences around it to stop it from talking to other processes and everything, and it can have its own file system and you can run Ubuntu in a Docker container even though your underlying operating system is Arch or Red Hat or Sentos or whatever.
14:26
The urge to say something is just, and not something nice. He's going, it's not very small virtual machines. I'm not standing here to listen to this inaccurate nonsense. So, yes, but that is the easiest way to think of it.
14:41
Before I go any further, it does get a bit confusing. So, Docker has these two concepts. You have images, which is like your virtual machine kind of configuration and your VHD file, and then you have containers, which is things that are running.
15:01
So, when you're creating your setup and configuring it and preparing it, you're preparing an image, and then when you run that image, it starts running in a container. Okay? So, that's what those two words mean. There's lots of other words that we could talk about, but I'm not going to. Okay. So, if we go and look at this Dockerfile
15:22
that was created for us here, there are actually two things wrong out of the box. If I were to build this, it would not work. And the first one, the first one's really inexcusable. Microsoft, as I say, created the Yeoman plugin for this.
15:43
So, they created this Dockerfile, and they got the name of the base image wrong. So, that top line there, the from says, what's the base image that I want to use to inherit for my image? And in the same way as it's turtles all the way down,
16:03
it's images all the way down. So, Microsoft's ASP.NET image that they maintain on the Docker Hub, that is derived from the official mono base image that is maintained by the mono team on the Docker Hub,
16:21
and that is derived from one of the Debian images, Debian Linux, and that is derived from scratch. So, when you create a totally base level Docker image with the actual Linux distribution on it, you say from scratch at the top there.
16:40
And then we carry on down and we say, okay, so we're going to copy the current folder into a folder on the image called app, and then we're going to cd into that, and we're going to run the new restore to download all the packages, and we're going to expose port 5000, and then we're going to specify our entry point, which is dnx.
17:02
The minus p project.json is the default. You don't need the minus p project.json. They've just put it in there in case they change the default and can't be bothered to update the Dockerfile, but that says when the Docker container starts, this is what I want you to run, and then when this exits,
17:20
the Docker container will close. The other reason that this won't work is slightly more obscure, and earlier on today, I was making sure that my demos worked, and I was getting massive demo fail all over the place, and I was going, why doesn't this work? And then I suddenly realized that I'd written a blog post
17:43
about the thing that was stopping it from working two months ago, and it's a very simple fix. The problem is that by default, so if we go down and look, when I say dnx-web, what the dnx command line tool actually does is it looks at this line here and says web,
18:02
and then it runs the command microsoft.aspnet.server.kestrel, and what that will do is start the application running, listening on port 5000 on local host, and if you listen on local host inside a Docker container, it listens inside the Docker container.
18:20
It doesn't listen outside the Docker container. We need to tell it to listen on the other address, so we say dash dash server dot urls http colon slash, let's close that so you can see, naught dot naught dot naught dot naught colon 5000.
18:41
Okay, and that says listen on all IP addresses. So if you've ever wondered what the difference between four zeros and local host is because they appear to do the same thing, actually the four zeros is also listening on all your IP addresses, so your Wi-Fi IP address and your internal IP address
19:00
and your VMware IP addresses and everything. So we have to add that in as well. Now we've done that, I can bring this back down, and I can, let's just clear the screen here, and we'll say docker build. So this is to create our image.
19:21
I've installed docker already. You've installed docker on your Linux box, or if you've got a Mac or a Windows box, you installed docker toolbox, which will put virtual box and a whole bunch of other stuff on your machine, but you'll still be able to run all the docker commands from the Mac terminal or PowerShell
19:42
or wherever you want to run this from. But I do recommend just put Linux on your box and do things on there. Or maybe not just jet, but as soon as project rider, as soon as jet brings thing comes out, I literally, the only reason I will have left to run Windows is iTunes.
20:00
I'm so losing my MVP award. It's just gone. Right, docker build, I need to specify a name for the image, so I'm going to say, I'm going to call this local slash hello dash NDC, and it needs one argument, which is to tell it where the docker file is. That's the current folder, so I'm going to say dot.
20:24
Okay, now, did I not save that file? No, I didn't save my change to the docker file.
20:41
That always helps. Right, let's try that again. There we go, so yes. Now, what that's doing is it's going off, so when docker builds an image, what it does is it starts the base image up in a container, and it runs the first command,
21:00
and then it saves that as a temporary image, so it commits the changes that have been made to that container as a temporary image, and then it starts that image as a container, and it runs the next command, and so it creates a whole bunch of temporary images as it's going along, until eventually, it runs the last command, commits that, and gives it the name that you told it to give it,
21:23
and one of the commands that we had in there is the new restore, and so, as part of the build, it's actually running the new restore inside a running docker container. Those files are coming down, being written onto that image's container's file system,
21:40
and then once it's done, we should see the rest of it go through fairly quickly. Fortunately, I have wired internet in here, because otherwise, this would basically take the next 45 minutes, and we could just kick back and go and get some early beers.
22:01
Come on. The other thing that you might notice that's going on here is that it is pulling down an awful lot of very basic stuff. If you look for long enough, you'll see it brings down system.runtime. If you don't have system.runtime installed,
22:20
then your application will fail with type system.void not found, at which point you go, I've never really thought about it, but, yes, I suppose system.void is a type. It's what F-sharp people call unit. So, yes, but it is pulling down the entire framework, system.io.file, system.primitives,
22:42
and reflection.type extensions, and the whole thing is coming down. Part of the reason for that is that, despite the fact that I'm using mono, the new restore uses project.json to decide what it's got to pull back down, and in project.json, we've got this framework section here.
23:02
Currently, this is going to change very soon, and I think it's going to become .net core 50 and .net 4.5, or something like that. But basically, at the moment, DNX 4.5.1 on Windows translates to the .net framework,
23:21
and on Mac and Linux translates to mono, and then DNX core is the .net core. How are we doing? Still going. I'm going to let this go through to completion because otherwise it leaves a mess all over your hard disk,
23:40
but before I forget, I'm just going to take that out because we're running on mono, so we don't need it to install all those packages and stuff. That's just ridiculous. We'll just take that off like that. Don't worry. Part of the point of doing this is to show you how to avoid having to do this ever again,
24:05
but you kind of need to make it do this just to kind of get the point across about how you don't want to. Maybe I could just have told you. It would have been quicker. So, yeah, this is possibly a downside
24:24
of working with Docker at first. The same thing happens. It doesn't matter. Pretty much anything you use these days that runs on Linux is going to have a package manager, so you could be writing something in Ruby. It's going to have to go and install a bunch of gems. You could write something in Node. It's going to have to do an NPM install.
24:42
Whatever it is, you're going to have to bring on a bunch of packages. Although this is taking longer. This is the longest it's taken so far today. I'm guessing this wired internet is not all it's cracked up to be. Come on.
25:07
20 or 30 megabytes. It's nearly done. You can sort it as it goes through. So, yeah, system.io.filesystem and system.txt.encoder. You can see it getting down to the more primitive stuff
25:20
because essentially what it's done is it's gone and it's looked in my project. There we go. That's it. It's done. Come on. So it commits that to another image. This is what's taking a minute now
25:41
while it writes that image. But, yes, just to talk about what it's actually been doing, it's gone through this set of dependencies here. So this, what is that, 12 lines of JSON. That's replaced the whole, all that XML in a CS Proj file
26:01
that's telling you what to install. But it looks at each of these and then it finds their dependencies using their project.json files or their new get packages and then it finds their dependencies and then it finds their dependencies and eventually it downloads the entire .net framework. But you don't have to specify all that stuff there.
26:22
So, yeah, that's the intermediate image ID that's being written out there. And we will get there in the end. It's like a whole new kind of demo. It's not fail. It's just I'm demonstrating something
26:41
that takes a very long time. So I'll just go through some slides while we're talking about that.
27:01
So the official image for ASP.NET on Docker is that one. Microsoft slash ASP.NET slash colon 1.0.0. So the parts of this are Microsoft is the name space. Think of it like the GitHub organization.
27:21
And then ASP.NET is the name of the image and then after the colon is the tag of the image. Usually the version number. But you also get colon latest. So whenever you do a build of your image, you push it to the registry and you give it its actual version number
27:42
and you also overwrite latest. So you get that down as well. And what official image actually means is if I go to hub.docker.com slash R slash Microsoft.
28:01
There we go. So docker.com is where images live. Everything is going slowly. My laptop is just not, I know why it's bad. I'll plug it in and get it to turn the CPU on.
28:22
That always helps. Is there a plug round here anywhere? There is, good. That's all right, I found it. It's an SSD if you believe it. And yes, I have just run trim.
28:44
Debian. I think it might even still be wheezy. It sort of depends what the mono image is on. So hub. And it's usually slash underscore slash mono because it is an official, official image.
29:03
So yeah, when you go to the page on each of these things, you can go there and you can see they have the docker files here. So the 4.2.1 is the latest.
29:22
And if we go here, yeah, you can see there. If I close that down and just zoom in a bit, it is actually Debian Wheezy, which has never been a more appropriate name. Debian Wheezy is like four years old. The current version is Jesse, but the mono guys haven't updated their image yet.
29:43
It's fine, it works. The only real issue with Debian Wheezy is if you're actually running it, it's got a very old kernel. It's like 3.2 or something. But when you're running in docker, everything that's running on it is running on whatever the kernel for the host machine is,
30:01
which in my case is 4.2. So that's okay. Oh, there's dozens. So Debian is the most commonly used because it's fairly small, but still a complete distro with a decent package manager.
30:24
If space is really a premium, the Debian base image is nearly 100 megabytes, I think. There is a distro called Alpine, which is 5 megabytes for the base image. And you can actually get an Alpine mono,
30:41
but when you get Alpine mono, it's 130 megabytes, which tells you something about mono. It's quite big. But yeah, the problem with mono is it includes LLVM, for example. And LLVM is 60 megabytes, so things do get quite big quite quickly.
31:03
Right, how are we doing here? There we go. Right, so I now have, if I do docker images, we can see up at the top there, let me highlight that, we've got local slash hello NDC. And I can start that by saying docker run,
31:23
and I'm going to say minus TI. Minus T says attach a terminal, a TTY, to the process, and I says make it interactive, which means I'm going to see the standard output and standard error from any processes as the image runs.
31:43
The other thing I need to do is tell it that I want to link a port from the docker container to a port on my actual network bridge. So I'm going to say colon 5,000. So that's the host port that I want to bind, and I'm going to bind that to port 5,000 on my docker container.
32:03
And then I just say local slash hello NDC. And that's just going to start that up, and that's now running inside a docker container there. And I can go back over to here, and I can go control T local host 5,000,
32:22
and there is the same application running inside a docker container. Yay, we've achieved so much. We've gone to exactly the same address and exactly the same thing has happened. Don't worry, it does get better, I promise. Right. So, first thing,
32:40
I don't want to have to run that whole build process every time I do a build, okay? I don't want it to have to do the Danu restore. And people who do node applications and so forth have found ways around this. And one of the things you can do
33:01
is you can copy project.json into your app directory and then run Danu restore, and then copy the rest of the files on and then build the application from that. When you say docker build, it works out what's changed,
33:22
and so if project.json hasn't changed, it will start from the image where it had already done that last time, okay? So that makes things a lot quicker. But it doesn't make them particularly quick all the time. And the thing is, if I can just find, there we go,
33:40
that's the official coreclr image, so at the moment it's got dash coreclr on the end. By the time this goes actual 1.0 final final final, I suspect that the default will be coreclr and you'll have to expressly say you want mono. But yeah, so you've got your docker file there,
34:00
which looks like that, we've already looked at that. But to save time, the thing is, when you write a node application, everything has to go into your node modules folder inside the actual application itself. ASP.net 5 doesn't work like that.
34:21
It actually puts the packages into a shared location, which is common, so across all the different things. It's versioned, it's sort of a bit like the GAC, but it's not. For a start, it doesn't write a whole bunch of GUIDs into the registry as part of putting a file in there. It is just a folder.
34:41
But if I say install microsoft.aspnet.mvc and all its dependencies, it goes into a shared location. The next time I say denourestore, it just goes, I've got it cached. And so what I've got is...
35:01
Let's make that a bit bigger. Cloud lens images dnx docker. And so I've grabbed myself a project.json
35:21
from a Yeoman output. I've taken out the dnx core 50 line there, and then I've basically just got a docker file here that goes from Microsoft's base image,
35:41
copies my project.json file into the temp directory, and runs denourestore. That pulls all those packages down into the images slash root slash .dnx slash packages, and then I delete the project.json files and I set the work back to slash where it should be,
36:02
and I've created an image that has already got the most common packages and all the system.runtime and everything else pre-installed into it. So if I go back to my docker image here, and I'm just going to change this.
36:21
So I have a docker repository as well. It's called cloud lens. And I have published my pre-restored image up there as just aspnet colon 1.0.0-rc1. So if I save that, and we'll go back to here.
36:46
So you can see that was showing the output from my application there. And I'm going to just come down here. So docker build. So this is going from this docker file,
37:00
but this is using my pre-restored image. This is on the docker hub, and you are perfectly free. There's no kind of clever licensing or everything. So if you want to use cloud lens slash aspnet as your base image, feel free to do that. If you want to copy the docker file from my repo on github and adapt it or maybe add like newtonsoft.json
37:22
or something to the project.json file, you're absolutely free to do that as well. But now when we do, oh god. I'm pretty sure that's what I called it, but never mind, we'll just say latest because it's the same thing.
37:52
There you go. So that's pulling that down. That's pulling my thing from the image there.
38:02
I almost don't want to let that finish. Right. So you come here, hub.docker.com slash cloud lens,
38:32
tags, build details. Oh no, I did put, I left vinyl on there. There we go.
38:41
That'll make life a lot easier. Right. 1.0.0-rc1-final. OK. And we'll start that again because I do already have that on my machine. There we go. And so you see that's just used the cache built into that docker image. So that runs incredibly quickly
39:00
and I don't have to worry about that taking ages every single time. So that's quite cool, right? That saves a lot of time and then I could run that and we'd still be at exactly the same point as before. OK, let's not do that because that's not a good use of anybody's time. And whilst I might not care about yours,
39:22
I do care about mine. No, wait, I got that the wrong way around. Sorry. So yeah. When you're actually sat at your desk, when you go back to work and say, we need to do everything in ASP.NET 5 and Docker because Mark Rendell said so. And they say, right, there you go. And you sit down. Even with a kind of pre-filled image,
39:44
that process has gone from F5 Internet Explorer opens, you close Internet Explorer, you go back, you change the browser to Google Chrome and you press F5 again and it just launches and you get that nice flow there. This is going to slow that flow down a lot.
40:01
And generally, even if you're not working on Docker, you still have to kind of go out, stop the process and restart it every time you change some code. Node has something called nodemon and various other things that just check to see if any of the files change and if they do, it restarts the process. And now, on ASP.NET 5, we have dnx-watch,
40:25
which is almost certainly going to change to .net-watch, but never mind. And that does the same thing. You say dnx-watch in a folder and it watches the code that's running and if you change anything and save it, it just stops the process and restarts it.
40:41
And so you go back to the browser and hit F5 and it reloads the page using the new code. And so, as well as creating a preloaded ASP.NET container, I created a dnx-watch container
41:01
and that looks like, where are we? I quite clearly closed that. Right, so, the image for that is here
41:21
and again, this is on, so you can just do cloudblends slash dnx-watch and pull this down as well. But if I do the cat Docker file,
41:46
so yeah, this is a bit more interesting. So what we've got here is the same thing up at the top there to save it having to do the actual reload every single time. But then I've added some extra variables in to say what the dnx version is and what the user home is
42:00
and then we're gonna install the dnx-watcher there. So that's, it's a Microsoft package and in the same way as you can do npm install minus g, you can say to new commands install to install something that's actually supposed to be run from the command line. Then, and this is the fun bit, we declare a volume in our Docker container.
42:23
So a volume is a mount point, effectively, in the Docker container. It's saying I am exposing this volume and you can mount something onto it and also, if you want to, you can see it from other containers, okay? So to run my application,
42:43
my Hello NDC application, using that, I say escape slash dnx dash watch. Yay, there we go. I love bash.
43:00
So this is my new Docker run command. So I'm not actually, I don't need a Docker file at all to use this. It doesn't need its own Docker file because that dnx dash watch image will work with anything, okay? And you can see there that I'm set using dash e
43:20
to set an environment variable. That's telling it where my project is and then I've got dash v and I'm setting the present working directory and mounting that to the slash project volume inside this container. That won't actually work because I've broken some rules on there, but it's time to jump into the project
43:43
that I prepared earlier. So let's just shut that down and we'll go out of here and into demo, right, and we'll start from here, okay?
44:10
So here is the demo application that I prepared earlier. This is called MicroStuff and this will work perfectly if I run this here, okay?
44:36
Hopefully. This is having to install, so part of what it does as it starts up
44:40
is it runs an install and I'm just going to make sure that I can see, nope, okay.
45:13
Sometimes you just have to restart your entire network stack.
45:20
There we go. That would have been so much harder on Windows. That would actually have been please bear with me while I reboot Windows. Okay, so let's go back over to where I was doing that and we'll try that again. Right, there we go. That's done the restore properly now
45:41
and that's going and it's getting newtonsoft.json and system.net.http which are the additional dependencies that I have in this application and now that's running there. So the fun thing now, okay, is if I go to here, if I hit F5 again,
46:01
that's just going to display exactly the same stuff but if we go and look in my home controller, what I've done here is I have parameterised all those banners in that carousel at the top so that they're data-driven in this application. I didn't manage to get this uploaded to GitHub because I don't know if you've used the Wi-Fi
46:21
and tried to do a git push. It's not good, it doesn't like it but I will push this and do the thing. But yes, you can see here that I have put the text and everything for these banners into code rather than into the CSHTML. If you change CSHTML and hit F5
46:41
it will just rebuild it because Razer's good like that but if you change your code then things are different. So if I go learn, that's it. We'll do that. And I'm going to go up to here and I'm going to say learn how to
47:04
run ASP.NET apps or learn how to ASP.NET apps. Run ASP.NET apps in Docker. Save that.
47:20
And if we go back to here you can see that you've got the file changed. So this is inside the Docker container. The DNX has picked up the fact that my mounted folder which is mounted on a volume in the Docker container something's changed and it's restarted the application and if I go back to here and do that and hit F5 and it refreshes and it says there you go
47:42
learn how to run ASP.NET apps in Docker and for the people at the back yes it does. Okay, so that's good. So we can start our application running in Docker and we can make changes to it and we can save it and we don't need to keep rebuilding our Docker container
48:01
so we're getting somewhere. This is already quite good. There's my slides. Okay, but the question is why would you want to have the application running inside Docker if you're on your local machine and you don't need that.
48:20
So there are various reasons why you might do this. One of the reasons I do it is because the new .NET stack the stuff that they were talking about David Fowler and Damian Edwards have been talking about where the new and DNX have been replaced by .NET At the moment you can run it on Windows and you can run it on Mac and you can run it on Ubuntu 14.04
48:44
and you can't run it on any other flavor of Linux at all which means I can't run it on my Arch Linux laptop and I'm buggered if I'm putting Ubuntu 14.04 as the actual operating system on my laptop but I can use the Ubuntu 14.04 base image
49:02
and I can run the .NET stuff inside that. So that's one use for it. But the other use for it is that oh, don't ask about debugging inside Docker. Someone always goes what's the debugging story inside Docker containers and I just say it's a very short story and it doesn't end with
49:21
and they all lived happily ever after. You can't do it yet. You probably will be able to at some point if you ask that question I will rip your arm off and beat you to death with a bloody end. So yes, actually at the moment off Windows it's the same very short story with an unhappy ending
49:42
but they are working on it. The problem is that .NET and Mono and .NET Core had a completely different set of ideas about what a PDB should look like and then they all got together and went how about we standardize on this and funnily enough it was the Mono people
50:03
who had to do the most work. Odd that. So yes, they have come to an agreement and it's going to get better and you can do remote attaching and so forth. It's going to get there. Once you can do remote attaching you should be able to just open an additional port on your Docker container and you should be able to debug stuff
50:23
running in Docker containers. Okay, so that's kind of fun. But the other thing that I've done when you get into Docker when you start thinking in terms of running stuff in containers deploying becomes a lot easier. Updating your stuff becomes a lot easier and all that crap
50:41
that Martin Fowler has been coming out with about microservices suddenly makes a lot more sense. When something is literally just a matter of building an image, pushing it up to your machine and starting it and then taking the old one down you kind of go it's not such a big thing so I'm going to make lots of microservices
51:00
so Cloud Lens which, so Zudio works with Azure storage, it works with blobs and tables and queues and files and analytics and all these different things. Was one big application, it's now there are like two applications for each area so I have a blobs container and a tables container and a base container and all sorts of stuff. The thing runs
51:21
and it uses multiple domains and cores and it's all great and if you make a request against blobs it sends it to a specific service in that data center and everything else. Which is an absolute sod the problem with microservices is that they're really difficult to develop because you have to have all these microservices
51:40
running on your machine or you have to have a kind of set of development shadow microservices that you can run against. Microservices with Docker is a lot easier and I've been working on something during the day for my customer at the moment where we are using
52:00
Kafka the kind of distributed Java message bus thing and we're using a Mongo database and there's lots of different pieces and it's like eight Docker containers that we drag up in order to do this. And you don't bring them all up one at a time I mean you don't write shell scripts
52:21
we have something called Docker Compose and Compose you define your entire setup in a YAML file and then you say Docker Compose up and it just brings up however many Docker containers you've specified and sticks them all together and so I can put all the different
52:41
projects that make up all the different backend services for Cloud Lens into a Docker Compose dot YAML file and I can make that run all at the same time and I can take it all down at the same time and I can clean them all up at the same time and everything else.
53:01
So let's take a look at what a Docker Compose file looks like. Right. So this is Docker Compose I'll make that as big as I can. That's it. Can you see all right at the back? I can go probably one more and do a bit of scrolling. All right, good.
53:23
So what we've got here, ignore that top one just for a minute, we've got micro stuff and within that I've said build so my first property there is build and that's saying to Docker Compose use Docker to build the Docker file that is in
53:42
SRC slash micro stuff. When you run the container give it the name micro stuff and link it to carousel and then down at the bottom we've got carousel here which is building something else and giving it a different name, okay? And these are both ASP.NET
54:02
applications. I haven't changed anything at all. They both run on port 5000 and I can't bind port 5000 from two containers to the same port on my local box and actually I've got subdomains and all sorts of stuff going on here so what I really want to do is to get these things working with proper domains.
54:22
The other reason that that's incredibly useful is when you're doing Windows Live or Microsoft account authentication which refuses to let you put a localhost URL as the callback. So I have microstuff.io that's just pointing to localhost and star.microsoft.io
54:41
microstuff.io is pointing to localhost, okay? The thing up at the top is possibly the single most useful Docker image since the DB and Weezie base image, okay? It's magical. What that does so that's using an image Jay Wilder is this guy who just
55:02
does amazing Dockery things, okay? And that it runs Nginx and it exposed so we'd link Port 80 inside there which is what Nginx is running on to Port 80 on the local machine. You normally couldn't do that but the Docker daemon service that's running
55:21
on Linux and taking care of all this is running with super useful permissions so it can bind stuff to Port 80. And then the volume that we're mounting there we're taking our Docker dot sock which is the Unix domain socket that Docker the daemon uses
55:41
to accept commands and pushes events out on and we're mounting that into a Docker container. So the container is actually talking to the Docker process that is running the container which is just wonderfully meta. And once we've done that it just sits there and it says to the Docker process tell me
56:02
when a container starts and the Docker process oh I've started a container and it's called carousel and it goes and it says can I see the details for that carousel in particular I would like to know what ports it exposes and I would like to know does it have a virtual underscore host environment variable that I can see.
56:20
And Docker says yes it does and he regenerates the Nginx dot conf file to point carousel dot micro stuff dot IO host header requests to that Docker container and it does the same thing with micro stuff dot IO. So the effect of this
56:42
is that I can say Docker dash compose up so recreating carousel starting proxy recreating micro stuff
57:04
once that's up we'll see the output there. So Docker compose one of the things it does that I love is it colors the output from the different things different colors. So and it's random every time there may be a parameter you can pass in that controls it.
57:20
So micro stuff is green carousel is blue and proxy is yellowish. And now I can go back to my browser thing here and I can say control T and I can type in micro stuff dot IO and we'll get that pop up there like that.
57:41
Oh look at that. It's still doing that thing. It shouldn't be doing that. Let's just jump back over to here. We'll shut that down. So what what's happened is that the last time I ran Docker compose it built that I've kind of ruined my big kittens moment now. Never mind. So yes I shut this down like
58:00
that. Right so I'm going to do Docker dash compose build which will force it to rebuild those images there like that. Okay. And I haven't gone yellow on this thing yet. I don't know if I've got like an extra
58:21
five minutes at the end or you're just really enjoying the talk or something. Okay. It's good. He's really enjoying the talk. Right. And then we'll do Docker compose up again. Okay. And let's go back over to here and we'll try doing control f5 on that. There we go. Right back to
58:41
normal. Hurray. So yes I can forget the kittens. The kittens never happened. Look into my eyes. Look around my eyes. Look around. Yes. So yeah we're back to there. Right. Now so I could change it and I could do Docker compose build and Docker compose up and everything. But that would take
59:01
far too long. So let's jump back out to here as well. And we'll stop those things like that. so we're going to MV Docker compose dot YML to
59:21
Docker dash compose dot YML dot slow and boring. Okay. And then we're going to MV Docker dash compose dot YML dot watch to Docker dash compose dot YML. Okay. And then we're going to open this up and we're going to
59:41
look in here. So this I think I might have a slide for this. Putting it all together. Yes there we go. This is the really good bit. This is the kind of piece de resistance of the entire talk. So I showed you DNX watch.
01:00:00
which allows you to do a live reload inside a Docker container, yeah, and I've showed you Docker Compose, which allows you to bring multiple things up at the same time, and so now I'm going to put those two things together. So in my Docker Compose file, I am saying use the Cloud Lens slash DNX dash watch
01:00:20
image. I'm using the Docker information here to set the DNX project environment variable, and I'm using the virtual host thing there to tell Nginx proxy what to call stuff, and I'm mounting my current folder, so I've got my volume section there, and I'm mounting
01:00:42
that into the DNX watch image container, and also I've added a link entry there to say that microstuff needs to be linked to carousel, and what that's going to do is it's going to add an entry to the etc hosts in the microstuff container pointing to the IP address of the
01:01:07
carousel container, okay, so I don't have to worry about what its IP address is. If I say ping carousel from inside microstuff, it will just ping it automatically, okay?
01:01:21
So I can do Docker Compose up there, don't have to worry about rebuilds and everything there, okay, and there you can see that's doing a little bit more work as it brings those up, but pretty soon we should see the, it's started and it's listening on port 5000 things going there, so yes, running DNX watch, listening on 5000, and we should
01:01:45
see another quick one of those going past there as that one starts up. Okay, so I now have my SRC project, all my code is mounted into two Docker containers that are running on two different URLs in two completely separate processes, isolated
01:02:02
from each other, only able to communicate over TCP and HTTP and so forth, and if
01:02:21
So that's still doing basically the same thing. If I now go into my hello controller here, right, and go back up to the top here, you can see I've got my var banners equals banners there, I'm going to comment that line out and I'm going to uncomment this line here, all right, and this is talking
01:02:44
to the carousel microservice, so there it's using carousel and it knows it's running on port 5000 because it's a .NET application and they all run on port 5000, and it's consuming carousel as a microservice, okay, and it's going I need your API, give me a list
01:03:01
of all the banners that I should display in here, okay, and if I save that and we jump back out and look here, we can see that that's restarting there, and that started, and then I can go back to my page here, and I can say F5, and it's switched across
01:03:22
to using the stuff that's sourced from the carousel microservice, because you might have a content management site or something, you don't necessarily want to have to redeploy your entire site just because you want to add a new banner into the carousel or something,
01:03:41
so you have a kind of microservice that drives your carousel from a database or something, and you can switch that around, but, yes, learn how to build lightsabers that kittens can use, and we do have more links on there as well, so, yes, there are powerful new features in the dark side of the force. Darth Kitten. So, yes, and that's coming
01:04:06
through from there, and the other fun thing that's happening with that is that if we go to the banners controller, so this is the API controller in the carousel application, okay, and you can see here that we specified a host at this point which is carousel.microstuff.io,
01:04:27
and then we're just using, if you haven't done C sharp 6, that image URL there is using string interpolation to just put that host property in, and so this is why I need, although carousels being consumed internally as a microservice, it's also exposed with the carousel.microstuff.io
01:04:48
domain so that it can serve those static images out as well, so I've got the images and the data coming from this microservice which I can switch around, and so this is
01:05:01
how I have been working on my application when I do Docker Compose up when I'm working with Cloud Lens. It brings up up to a dozen Docker containers. I'm running on a fairly old dual-core laptop with eight gigs of RAM, and it works, and it's not painfully
01:05:21
slow, and I can still keep Visual Studio Code running at the same time, and I can debug it, and everything is nice, and so you get this running on something with a bit more oomph. If you're going to do this on Windows, if you want to use Visual Studio and Windows, then you can use Visual Studio, mount the directory that you're running
01:05:44
into a Linux VM, and then run all this stuff inside the Linux VM but use Visual Studio to edit the CS files and the CS HTML files. That works great as well, but you do need a quad-core machine if you want to do that. So, yes, that is basically the story for
01:06:05
running ASP.NET 5 on Docker at the moment. I got the timing just about right, so that's it. I hope that gave you a good introduction. I hope it gave you a taste of what we can do now, now that Microsoft have decided to open things up and join the rest of the world,
01:06:24
and go off and try it. I will push all the code from this microstuff service up to GitHub when I get a decent internet connection. Any questions? I think we have run out of time, so we need to stop, but do feel free to come up and we will go and sort
01:06:42
of grab something. You can get me on Twitter, Mark Rendell, or mail me mark at rendell.io. I've got some cards if you want those. Thank you very much for listening to me. Enjoy the rest of your conference.