2. Who is @tanaka_733?
Working for Red Hat K.K.
◦ Responsible for .NET Core on RHEL, Red Hat on Azure and OpenShift
◦ OpenShift: Container Platform as a Service. “Enterprise” kubernetes
◦ kubernetes: one of docker orchestration platform
Microsoft MVP for Visual Stduio and Development Technologies
◦ Recent Target: .NET Core on Linux, C# 7.0, Linux on Azure
SQL Server on Linux
◦ Blogs: Red Hat Developers
https://medium.com/@tanaka_733/
3. Takeaways
What is the docker?
Getting Started docker for Windows
Getting Started ASP.NET Core on docker with Visual Studio 2017
5. VM and docker
Host Hardware
Host Linux OS
Hypervisor
VM
Virtual HW
Guest OS
Process
Process
Process
VM
Virtual HW
Guest OS
Process
Process
Process
Host Hardware
Host Linux OS
Process
Docker Engine
Container
Process
Container
Process
6. docker and Windows
Docker for Windows
◦ Supporting Linux Docker
◦ Working with Hyper-V (required Windows 10 Pro/Enterprise/Education)
◦ Running docker host Linux OS as a Hyper-V guest VM
◦ If not satisfy, you can use docker toolbox (VirtualBox)
Windows Server Container & Hyper-V Container
◦ Container technology for Windows
◦ Windows Server Container: lightweight, run as a host OS process
◦ Hyper-V container: high isolation, run as a process in Hyper-V guest VM
13. Visual Studio 2017 & docker
Visual Studio 2015
◦ supporting docker by Visual Studio extension
◦ docker tools for VS
◦ This extension will be open sourced.
Visual Studio 2017
◦ supporting docker without extension
16. Dockerfile example
FROM microsoft/aspnetcore:1.1.1
ARG source
WORKDIR /app
EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "DockerExample.dll"]
Base Docker image
Pass the argument during build
Specify Working Directory
Expose the port to listen
Copy local binary into docker
Specify the command to run
You have to build your app before docker build.
$ dotnet publish -c Debug
17. What’s docker-compose?
Compose is a tool for defining and running multi-container Docker applications.
◦ https://docs.docker.com/compose/overview/
The generated compose file is a starting point.
◦ A single container for debugging and releasing.
◦ You can add more containers to require your app.
◦ e.g. Add database container, redis container etc…
18. docker compose example
services:
dockerexample:
image: dockerexample:dev
build:
args:
source: ${DOCKER_BUILD_SOURCE}
environment:
- DOTNET_USE_POLLING_FILE_WATCHER=1
volumes:
- ./DockerExample:/app
- ~/.nuget/packages:/root/.nuget/packages:ro
- ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
image name
pass the ARG into Dockerfile
Environment Variables
Mount a volume.
Volume source is host OS (Windows)
23. Deploy to the Azure App Service on Linux
What’s App Service on Linux?
◦ Linux version of App Service
◦ App Service is so called “PaaS”
How to deploy?
◦ Deploy from Visual Studio directory.
◦ Use App Service source code integration.
◦ Commit code => App Service pulls code and builds it on its cluster.
◦ Creating docker image and deploy the image.
◦ Commit code => Build a docker image => push the image to private docker registry => app service pull the image
26. Do you want to deploy to other?
Azure Container Services
◦ Easy to start your own orchestration cluster in Azure. Supporting kubernetes, DC/OS and Docker swarm
Google Container Engine
◦ kubernetes base
Amazon ECS
◦ container platform by Amazon. integrated with other Amazon services.
And many other orchestration tools…
OpenShift by Red Hat
◦ “Enterprise” kubernetes
◦ Adding features to kubernetes: project, build from source, routing and so on.