Docker for .NET Developers
-
Upload
taswar-bhatti-mvp -
Category
Technology
-
view
397 -
download
0
Transcript of Docker for .NET Developers
Docker .NET Core DevelopersTASWAR BHATTI (MVP)@TASWARBHATTI HTTP:/ /TASWAR.ZEYTINSOFT.COM
Agenda - What is docker?
◦ Images and Containers◦ Docker vs VM◦ Tools
- Dockerfile
- Docker linking with other containers
- Docker compose
- Summary
What is Docker? - Lightweight, open, secure platform
- Simplify building, shipping, running apps
- Shipping container system for code
- Runs natively on Linux or Windows Server
- Runs on Windows or Mac Development machines (with a virtual machine or Hyper-V)
- Relies on "images" and "containers"
Images and Containers
Docker Image - Ubuntu, DotNet Core, Node etc
- An image is an inert, immutable, file essentially a snapshot of a container
- A read-only template composed of layered filesystems used to share common files
- Create Docker container instances
- Created by docker build command
- Stored in Docker registry (Docker Hub)
Docker Container - Container is an instance of your image but running
- Using the docker run command
- An isolated and secured shipping container
- created from an image that can be run, started, stopped, moved and deleted
Docker vs VM
Tools for Docker - Install docker from https://docs.docker.com/
Kitematic A GUI component for Docker
- Allows one to control the container (start, stop, remove, etc)
Demo of Kitematic
Dockerfile - A dockerfile is a simple text file that contains the commands a user could call to assemble an image.
Dockerfile (Sample) FROM microsoft/dotnet:latest
COPY . /app
WORKDIR /app
RUN ["dotnet", "restore"]
RUN ["dotnet", "build"]
EXPOSE 5000/tcp
ENV ASPNETCORE_URLS http://*:5000
ENTRYPOINT ["dotnet", "run"]
Linking Docker Container Demo
Docker Compose
Docker-compose.yml
Demo