Showing posts with label Docker Containers. Show all posts
Showing posts with label Docker Containers. Show all posts

Sunday, October 4, 2020

Azure CLI

 Azure CLI (Command-line Interface) is a command-line tool for Manager azure services. It's like Angular CLI, it provides various commands to manage Azure services in an Account. Before we can start using Azure CLI we need to install it, the latest version of Azure CLI can be installed from the following site.

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest

Once Azure CLI is installed run the az --version command to make sure that the installation was done successfully. 

Thursday, October 1, 2020

Docker in Visual Studio

Create Docker Image with .Net Core executable

 In the previous post we saw how to create an Executable (.exe file)  for a .Net Core console application. In this post we shall see how to package this .exe into a Docker image and deploy it as a Docker Container. 

First we will have to create a Dockerfile, we will create this file in the publish folder where the publish results (.exe files) are created.    

Monday, September 28, 2020

Updating Dockerfile and rebuilding images using VisualStudio

 In the previous post we saw on how to create a .Net Core console App and use Visual Studio to automatically add Dockerfile to the project. In this post, we will see how to change the Dockerfile created by Visual Studio and rebuild the Docker image with the modified file.

Once the Dockerfile is created we can manually exit the Docker file Add/Modify steps and rebuild the Docker image.

In this sample, we will add proxy settings to enable package restore in a Corporate firewall environment.

Docker Getting Started

Friday, September 25, 2020

Building a HelloWorld Docker images

 We have seen how to pull a Docker image from DockerHub and run in, now we will see how to create our own Docker image, build and run it.

The first step to create a Docker image is to create a Dockerfile.
Dockerfiles is a text file that contains instructions and steps to create a new Docker image.

A Dockerfile has no extension. If you are using docker on windows use notepad to create a dockerfile while saving select "All type" and save the file name as "Dockerfile".

Friday, September 18, 2020

Listing and Removing Docker Containers

Docker supports a set of commands to operate on Docker Containers. It supports commands to list Containers, Remove containers etc. Below are some of the commonly used commands for Docker Containers.

Running first Docker Container

Once we install Docker and make sure it is up and running we can start running our first Docker Container. Let us run the hello-world Docker container, this container is present in the DockerHub. We will use the docker run command to run the container as follows.

Thursday, September 3, 2020

What is a Docker Container?

When we develop an Application and move it between various environments QA, Staging, Production etc, we need to take care of various environmental factors like Operating System version, security patches, network configuration etc. When there is any deviation in these settings the application starts behaving differently and becomes difficult to identify the cause.

Containers help us make this easier, Containers are an abstraction at the app layer that packages code and dependencies together. A Container packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.

Multiple containers can run on the same machine and share the OS kernel with other containers, each running as isolated processes in userspace. Containers take up less space than VMs.

Docker Container vs Virtual Machine

A Virtual Machine is an image that runs on top of a physical server. We can create multiple Virtual Machines on top of a physical server. Each Virtual Machine needs a Guest operating system to function, this makes is heavier since each Guest OS needs Memory, Disk, and CPU to operate. 

A Docker Container can be seen as the next version/improvement to a Virtual Machine. Each Virtual Machine in a server needs a separate Guest operating system to function, but all the Docker Containers in a server use the same underlying Operating System of the server, hence Dockers are lightweight when compared to Virtual Machines. Also, Dockers are faster to spin up and execute when compared to Virtual Machines.

Since each Docker containers don’t need a separate Operating System we can spin up many Docker Containers in a server then the number of Virtual Machines it can handle.

What is Docker?

Docker is an open platform to create, deploy and run applications by using Containers. Docker makes is easy to deploy applications from one environment to another. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and deploy it as one package.

Docker can be seen as an improvement to a Virtual machine. Each Virtual Machine in a server needs a separate Guest operating system to function. All the Docker Containers in a server use the same underlying Operating System of the server, hence Dockers are lightweight when compared to Virtual Machines. Also, Dockers are faster to spin up and execute when compared to Virtual Machines.

The Docker platform contains the following components