Upgrade to Pro — share decks privately, control downloads, hide ads and more …

.NET Core on Linux within Docker Container 👻/fukuten-20161031

.NET Core on Linux within Docker Container 👻/fukuten-20161031

Fukuoka.NET (ふくてん) #4 ~.NET Core Party~でお話したLT資料です。

Kunihiro Morita

October 31, 2016
Tweet

More Decks by Kunihiro Morita

Other Decks in Technology

Transcript

  1. When building Docker images for developers, we focused on three

    main scenarios:1 » Images used to develop .NET Core apps » Images used to build .NET Core apps » Images used to run .NET Core apps Why three images? 1 https://docs.microsoft.com/en-us/dotnet/articles/core/docker/building-net-docker-images 2016/10/31 Fukuoka.NET (Fukuten) #4 ʙ.NET Core Partyʙ 4
  2. Images used to develop .NET Core apps1 Development How fast

    can you iterate changes, and the ability to debug the changes. The size of the image isn't as important, rather can you make changes to your code and see them quickly. Some of our tools, like yo docker for use in VS Code use this image during development time. 1 https://docs.microsoft.com/en-us/dotnet/articles/core/docker/building-net-docker-images 2016/10/31 Fukuoka.NET (Fukuten) #4 ʙ.NET Core Partyʙ 5
  3. Images used to build .NET Core apps1 Build What's needed

    to compile your app. This includes the compiler and any other dependencies to optimize the binaries. This image isn't the image you deploy, rather it's an image you use to build the content you place into a production image. This image would be used in your continuous integration, or build environment. For instance, rather than installing all the dependencies directly on a build agent, the build agent would instance a build image to 1 https://docs.microsoft.com/en-us/dotnet/articles/core/docker/building-net-docker-images 2016/10/31 Fukuoka.NET (Fukuten) #4 ʙ.NET Core Partyʙ 6
  4. Images used to run .NET Core apps1 Production How fast

    you can deploy and start your image. This image is small so it can quickly travel across the network from your Docker Registry to your Docker hosts. The contents are ready to run enabling the fastest time from Docker run to processing results. In the immutable Docker model, there's no need for dynamic compilation of code. The content you place in this image would be limited to the binaries and content needed to run 1 https://docs.microsoft.com/en-us/dotnet/articles/core/docker/building-net-docker-images 2016/10/31 Fukuoka.NET (Fukuten) #4 ʙ.NET Core Partyʙ 7
  5. Docker image variations1 To achieve the goals above, we provide

    image variants under microsoft/dotnet. » microsoft/dotnet:<version>-sdk » microsoft/dotnet:<version>-core 1 https://docs.microsoft.com/en-us/dotnet/articles/core/docker/building-net-docker-images 2016/10/31 Fukuoka.NET (Fukuten) #4 ʙ.NET Core Partyʙ 8
  6. microsoft/dotnet:<version>-sdk1 that is microsoft/dotnet:1.0.0-preview2-sdk, this image contains the .NET Core

    SDK which includes the .NET Core and Command Line Tools (CLI). This image maps to the development scenario. You would use this image for local development, debugging and unit testing. For example, all the development you do, before you check in your code. This image can also be used for your build scenarios. 1 https://docs.microsoft.com/en-us/dotnet/articles/core/docker/building-net-docker-images 2016/10/31 Fukuoka.NET (Fukuten) #4 ʙ.NET Core Partyʙ 9
  7. microsoft/dotnet:<version>-core1 that is microsoft/dotnet:1.0.0-core, image which runs portable .NET Core

    applications and it is optimized for running your application in production. It does not contain the SDK, and is meant to take the optimized output of dotnet publish. The portable runtime is well suited for Docker container scenarios as running multiple containers benefit from shared image layers. 1 https://docs.microsoft.com/en-us/dotnet/articles/core/docker/building-net-docker-images 2016/10/31 Fukuoka.NET (Fukuten) #4 ʙ.NET Core Partyʙ 10
  8. Alternative images1 In addition to the optimized scenarios of development,

    build and production, we provide additional images: » microsoft/dotnet:<version>-onbuild » microsoft/dotnet:<version>-core-deps 1 https://docs.microsoft.com/en-us/dotnet/articles/core/docker/building-net-docker-images 2016/10/31 Fukuoka.NET (Fukuten) #4 ʙ.NET Core Partyʙ 11
  9. REPOSITORY TAG IMAGE ID SIZE microsoft/dotnet 1.0.0-preview2-onbuild 19b6a6c4b1db 540.4 MB

    microsoft/dotnet onbuild 19b6a6c4b1db 540.4 MB microsoft/dotnet 1.0.0-preview2-sdk a92c3d9ad0e7 540.4 MB microsoft/dotnet core 5224a9f2a2aa 253.2 MB microsoft/dotnet 1.0.0-core-deps c981a2eebe0e 166.2 MB microsoft/dotnet core-deps c981a2eebe0e 166.2 MB microsoft/dotnet latest 03c10abbd08a 540.4 MB microsoft/dotnet 1.0.0-core b8da4a1fd280 253.2 MB 2016/10/31 Fukuoka.NET (Fukuten) #4 ʙ.NET Core Partyʙ 13
  10. 1.0.0 GA » 1.0.0-preview2-sdk » 1.0.0-core 1.0.1 GA » 1.0.0-preview2-sdk

    » 1.0.1-core 2016/10/31 Fukuoka.NET (Fukuten) #4 ʙ.NET Core Partyʙ 14
  11. 1.1 Preview 1 » 1.0.0-preview2.1-sdk » 1.1.0-preview1-runtime, runtime 1.0.1 GA

    » 1.0.0-preview2-sdk, latest » 1.0.1-core, core 2016/10/31 Fukuoka.NET (Fukuten) #4 ʙ.NET Core Partyʙ 16
  12. Base Image $ cat /etc/issue Debian GNU/Linux 8 \n \l

    2016/10/31 Fukuoka.NET (Fukuten) #4 ʙ.NET Core Partyʙ 17