Integration with Docker and .NET Core

Preview:

Citation preview

Sponsored & Brought to you by

Integration with Docker and .NET Core

Elton Stoneman

https://twitter.com/eltonstoneman

https://www.linkedin.com/in/eltonstoneman

Integration with Docker and .NET Core

Elton Stoneman

blog.sixeyed.com

@EltonStoneman

&

OVERVIEW

• Docker: The Next Model of

Compute

• Why Docker?

• Docker for Integration

• .NET Core

• Running .NET in Docker

• Docker Compose

• Docker and Windows

OS

CoreCLR

App Code

DOCKER: THE NEXT MODEL OF COMPUTE

OS

DOCKER: THE NEXT MODEL OF COMPUTE

Isolation

vs.

UtilisationOS OS

DOCKER: THE NEXT MODEL OF COMPUTE

Isolation

vs.

Utilisation

OS

OS

HyperVisor

DOCKER: THE NEXT MODEL OF COMPUTE

Isolation

vs.

Utilisation

OS

OS

DOCKER: THE NEXT MODEL OF COMPUTE

1x app

10x VMs

100x containers

WHY DOCKER?

Dockerfile encapsulation

Built images

Shared image repository

Rich ecosystem

FROM sixeyed/coreclr-base:1.0.0-rc1-update1

MAINTAINER Elton Stoneman <elton@sixeyed.com>

# ensure the expected DNX is available

ENV PATH /root/.dnx/runtimes/dnx-coreclr-linux-x64.1.0.0-rc1-update1/bin:$PATH

# deploy the app

COPY /Sixeyed.Docker.WebApp /opt/sixeyed-dotnet

RUN cd /opt/sixeyed-dotnet && dnu restoreac

CMD cd /opt/sixeyed-dotnet/src/Sixeyed.Docker.ConsoleApp && dnx run

Self-contained

Repeatable

Scalable

DOCKER FOR INTEGRATION

DOCKER FOR INTEGRATION

v1

Containerize dependencies

DOCKER FOR INTEGRATION

v2

Containerize whole solution

DEMO: DEPENDENCIES IN DOCKER

DOCKER FOR INTEGRATION

Public images

Docker Hub

docker run

.NET Framework

.NET CORE

Not a full .NET runtime

.NET contains WCF, WPF etc.

Monolithic framework

Windows platforms

Legacy supportBCL

FCL

All-in-one

~50 MBFull

install

Syste

m.L

inq

Syste

m.T

ext.

Encodin

g

.NET Core

.NET CORE

Cross-platform .NET runtime

Built for ASP.NET 5

Console apps too

NuGet integral

Fx split into packagesCoreCLR

CoreFX

>100 Packages~00s KB

Binary copy

Syste

m.L

inq

Syste

m.T

ext.

Encodin

g

.NET CORE

OS

CoreCLR

App Code

DEMO: .NET CORE IN DOCKER

DOCKER COMPOSE

Grouping multiple containers

Self-contained definition

Versioned container images

Encapsulates configuration

Isolates solution

Enables scale

DEMO: DOCKER COMPOSE

DOCKER AND WINDOWS

Windows Server 2016

Natively run Docker containers

Even from Linux images

Windows Server Nano

Base Docker image

Minimal Windows footprint

DOCKER AND WINDOWS

Windows Server 2016

Natively run Docker containers

Even from Linux images

Windows Server Nano

Base Docker image

Minimal Windows footprint

DOCKER AND WINDOWS

Windows Server 2016

Natively run Docker containers

Even from Linux images

Windows Server Nano

Base Docker image

Minimal Windows footprint

THANK YOU

@EltonStoneman

blog.sixeyed.com

https://www.pluralsight.com/courses/ubuntu-getting-started