Containerize Your C# Application Easily with the .NET CLI

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ก.ย. 2024
  • Containers are a great tool, but putting your C# application into a container might be intimidating. Setting up a Dockerfile can be complicated. But now with the .NET command line, you can create a Docker container without a Dockerfile. I will show you how in this 10-minute training video.
    Full Training Courses: IAmTimCorey.com
    Mailing List: signup.iamtimc...

ความคิดเห็น • 69

  • @bogella2225
    @bogella2225 5 หลายเดือนก่อน +18

    For anyone struggling Docker containerization is a steep learning curve. But once you get it, it is very easy.

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน +2

      Here is training on Docker to get you up to speed: th-cam.com/video/WcQ3-M4-jik/w-d-xo.htmlsi=Fq1uL6k489YgprAm

  • @Keldarise
    @Keldarise 5 หลายเดือนก่อน +6

    I just wanted to say thank you, Tim.
    Three years ago, I wrote my first line of C# code. Today, I am working as a full-time software developer, and your videos and tutorials have been fundamental in my learning journey. I could not be happier!
    Thank you!

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      Fantastic! I’m glad my content had a part in your journey. Well done!

  • @marouanelhaddad8632
    @marouanelhaddad8632 5 หลายเดือนก่อน +5

    This is the perfect tutorial I wanted - Docker and C# - thanks!

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      You are welcome.

  • @jeffkennedy2269
    @jeffkennedy2269 5 หลายเดือนก่อน +1

    perfect, exactly what I needed to get me going on docker.

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      Excellent!

  • @NouraddinKhalil
    @NouraddinKhalil 5 หลายเดือนก่อน +1

    This is very useful video we need more videos like this "docker with dotnet"

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน +1

      Thanks for sharing!

  • @andergarcia1115
    @andergarcia1115 5 หลายเดือนก่อน +3

    Thanks, Master, for showing us new things and keeping us inspired.

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      You are welcome.

  • @monambike
    @monambike 5 หลายเดือนก่อน

    perfect video, made docker easier with an spare of seconds 👏🏻 love ur videos

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      I am glad it was helpful.

  • @mlsandreas
    @mlsandreas 5 หลายเดือนก่อน +1

    Thank you Tim for all your amazing youtube content!!

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      You are welcome.

  • @user-sy5fd7kn8w
    @user-sy5fd7kn8w 5 หลายเดือนก่อน +6

    Tim, this is useful as always, but in a limited way this time, sorry. As an architect for a multi million dollar organization, I need to see it along with how to publish the image to azure and use the image to run it in K8s. I appreciate the quick view, but would love to see it integrated in cicd pipeline and deployed to AKS through Azure DevOps Thank you as always.

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน +3

      This definitely isn't the complete process for CI/CD for container apps. That would be a series of videos. You can add that as a suggestion on the suggestion site: suggestions.iamtimcorey.com

  • @frankdibbink
    @frankdibbink 5 หลายเดือนก่อน

    Thanks Tim, explanation is clear and simple.

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      You are welcome.

  • @moaru98
    @moaru98 4 หลายเดือนก่อน

    i didnt kno you could shrink it..great viddeo

    • @IAmTimCorey
      @IAmTimCorey  4 หลายเดือนก่อน

      I am glad it was helpful.

  • @ManuelBasiri
    @ManuelBasiri 5 หลายเดือนก่อน

    Good day Tim. Can I please request a tutorial for implementing 2 factor authentication for .NET Blazor applications?

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      Thanks for the suggestion. Please post it at suggestions.iamtimcorey.com so others can vote on it.

  • @AhmedHassan-gk3tx
    @AhmedHassan-gk3tx 5 หลายเดือนก่อน

    Is there a way to add this command to Docker Compose, or do I still need a Docker file to build multiple projects?

  • @manoharprabhu7076
    @manoharprabhu7076 5 หลายเดือนก่อน

    Amazing content, great explanation

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      Thank you.

  • @moto_matt
    @moto_matt 5 หลายเดือนก่อน +2

    And how are you supposed to know about that Jammy-chiselled nonsense? Is it something that's documented somewhere as to what the options and included base images are?

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน +3

      They are all published here: hub.docker.com/_/microsoft-dotnet-runtime/

    • @moto_matt
      @moto_matt 5 หลายเดือนก่อน +1

      @@IAmTimCorey Thanks! My knowledge is 15 years out of date and I'm slowly playing catch-up. So much to learn, but your videos are much appreciated.

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน +2

      Yep, that can be overwhelming, but chipping away at it will get you there. I’m glad my tutorials have been helpful to you.

  • @ScorpioPL
    @ScorpioPL 5 หลายเดือนก่อน +1

    Huge container at 221MB... Playing around with AI and the CUDA containers that's up to 22 GB each :) Cheers!

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน +1

      Yeah, AI containers can be really large.

  • @beckyTrendz
    @beckyTrendz 5 หลายเดือนก่อน

    Thanks Tim, do I have to install a dependency to use Container family? It is not reducing the image size when I use in my app.

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      No, you do not. My guess is that you got the syntax slightly wrong, which caused that flag to be ignored.

  • @Rajeshsingh-ws5th
    @Rajeshsingh-ws5th 5 หลายเดือนก่อน

    That's really helpful. I request what's your view on No code low code platform like Salesforce or Power Platform. If you can.

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน +1

      Here you go: th-cam.com/video/ah1tEvAkojI/w-d-xo.htmlsi=NYOGPCFiR098jAl6

    • @Rajeshsingh-ws5th
      @Rajeshsingh-ws5th 5 หลายเดือนก่อน

      @@IAmTimCorey Thanks. Also expecting one full video on Blazor Class library. Can we create component library with page and code behind which we can reuse from nuget.

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      You can add that suggestion to suggestions.iamtimcorey.com

  • @rd_45
    @rd_45 3 หลายเดือนก่อน

    Thanks Tim

    • @IAmTimCorey
      @IAmTimCorey  3 หลายเดือนก่อน

      You are welcome.

  • @samsonquaye9913
    @samsonquaye9913 5 หลายเดือนก่อน

    Hello Tim,
    I'm just curious, what cmd extension are you using in command prompt

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      OhMyPosh with some tweaks.

  • @lolyasuo1235
    @lolyasuo1235 5 หลายเดือนก่อน

    Hello Tim,
    I am wondering if there is a need of Docker in development phase for .NET. I never faced a situation where a project was running fine in X machine but not in Y. The only need of docker during development phase i think is if you need components like Redis etc (so you don't have to install them in your PC).
    I am a bit confused of purpose of docker. It is more for development or for hosting/running applications after the deployment?. Because all the time i tried to use docker during development it make me slower. And if it works on my machine it will probably work in any other machine with .NET SDKs.

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน +2

      There are huge benefits to using Docker in development. First, it is first-class at setting up environments just like production very quickly. For instance, I can set up a SQL Server and deploy my database scripts to it in less than 2 minutes. Then, when I'm done, I can tear it all down.
      Second, you can more easily do integration and end-to-end testing by having your test suite spin up new containers, deploy the database, redis, etc. and then perform tests on it. Integration tests can actually fully reset the environment between tests in order to ensure a clean test every time.
      Third, we should have our development environment mirror production as closely as possible. That's why web projects now use https. It isn't for security on your own machine. It is because web apps can sometimes behave differently with http compared to https and we will be using https in production. In the same way, our applications may be deployed in containers in production. Therefore, we deploy them into containers on our dev machines in order to test our systems before pushing to central dev (or worse, production).
      Using containers in production allows us to deploy more safely and it allows us to scale more easily.
      These are just some of the reasons why Docker is so valuable in development.

  • @codewithstephen6576
    @codewithstephen6576 5 หลายเดือนก่อน +1

    The docker course is very basic, most are. There needs to be a course that teaches you how to setup docker for a full .NET project to use docker compose and actually run and debug the code as well as docker for integration testing and UI testing. There is literally no point in learning docker unless it full scope of how you would use it professionally.

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      My actual Docker course (not just my videos here on TH-cam) does go into a lot of detail on how to use Docker. However, what you are talking about is one specific use case, not the only way to use it professionally. If you have specific suggestions (like Docker compose or integration testing with Docker), you can put them on suggestions.iamtimcorey.com for others to vote on.

    • @codewithstephen6576
      @codewithstephen6576 5 หลายเดือนก่อน

      Ok, do they go into detail on how to a docker compose project inside visual studio to debug, setup multiple services and have them depend on each other with health checks etc, how to setup the frontend and backend to talk to each other and how to setup integration testing of an API and UI and how to include docker in the ci/cd pipeline and deploy to azure from github or azure devops? I am asking because that would awesome if it did
      @@IAmTimCorey

    • @codewithstephen6576
      @codewithstephen6576 5 หลายเดือนก่อน

      @@IAmTimCorey The main way docker is used professionally is docker compose. It would be nice to have a course that taught you how to use a docker compose project in visual studio and setting up a frontend, backend and db with ssl as well as integrating docker with ci/cd and integration testing for api and ui

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      I don't have that specific configuration in a video, but you could add it to the suggestion site. As for the most common way to use docker is with Docker Compose, I don't know that this is true. You can use multiple containers without using compose.

    • @codewithstephen6576
      @codewithstephen6576 5 หลายเดือนก่อน

      @@IAmTimCoreyfair point, but there are probably similar concepts just different names? You could choose the most popular and do a series on how to work with that from small mvc app to full scale micro services or even modular monoliths?

  • @SayWhaaaaaaaaaaaaaaaaaaaaaaat
    @SayWhaaaaaaaaaaaaaaaaaaaaaaat 5 หลายเดือนก่อน

    MISSING important things. How to access storage? Let's say i want to container my Website.. how to access wwwroot? where temp files like session data is created?

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน +1

      That's well outside the scope of this 10-minute tutorial. That's a deeper Docker discussion and one that probably takes a better understanding of how Docker works first. For example, you really don't want to store things in wwwroot that aren't a part of the container. For instance, image files associated with your website can be stored in wwwroot, and can be accessed with relative paths like normal. However, if users are uploading files, those should be stored in another location like cloud storage. The reason is because containers are meant to be scaled. If your host creates five containers off of your image, and a user uploads a file to one of them, the other four won't have access to that image.
      Now, if you are talking about doing this locally, you can set up your dockerfile to map a folder from your local disk into the container.

  • @vencislavvidov
    @vencislavvidov 5 หลายเดือนก่อน

    what for shell are using? and how is configured:)

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน +2

      I use Windows Terminal. I've tweaked it with Oh My Posh. Here is a post that will help explain tweaking the Terminal: www.hanselman.com/blog/taking-your-powershell-prompt-to-the-next-level-with-windows-terminal-and-oh-my-posh-3

    • @vencislavvidov
      @vencislavvidov 5 หลายเดือนก่อน

      @@IAmTimCorey I think i have done it somewhere in the past once, unfortunately i do not have it any more:(, thanks a lot

  • @gower1973
    @gower1973 5 หลายเดือนก่อน +3

    But why do you need to containerise .Net applications in the first place, I thought .Net was open source and cross platform?

    • @krhek
      @krhek 5 หลายเดือนก่อน +4

      Think of containerization as "running the app on a virtual machine". A container is a small VM, with everything that's not essential stripped down.
      That's why you see in the video, Tim is publishing his app for Linux, even though he runs Windows.
      The goal is making development and deployment easier. And it's not only for your app, it's for the dependencies.
      Normally, with local development you had to install a database, maybe RabbitMq locally. What if you work with apps, one uses the latest version of Postgres and one uses an older version? That's when running the mini-VMs becomes handy.

    • @achavis
      @achavis 5 หลายเดือนก่อน +3

      Another huge benefit of containers is the ease of scaling. You can easily scale up to 100s or 1000s of instances to meet demand. Also you can easily automate scaling the number of instances up or down based on traffic.

    • @sirus49
      @sirus49 5 หลายเดือนก่อน

      @@achavis ya and have you ever actually scaled to 1000 instances?

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน +2

      Containerization makes configuration and deployment easy. If it works locally, it will work in the cloud. This allows you to be able to easily deploy your app to an Azure Web App, then move it over to a container service for scaling for instance. It also allows you to easily have an application that will always run at that point in time. There are a LOT of reasons to use containers.

  • @WernekTheVader
    @WernekTheVader 5 หลายเดือนก่อน

    👍