Visual Studio provides an option to automatically add Docker support. Using Visual Studio we can add the Dockerfile to a project without having to manually create one. Visual Studio will create the Dockerfile with the commands pre-populated based on the type of project, we create.
In this post, we will create a Console application using .Net Core and use Visual Studio to automatically create the Dockerfile for the Project. First, let us create the following Console application.Monday, September 28, 2020
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 Images
In the previous post we saw on how to pull and run Docker
Images from a remote repository. Once we pull a Docker Image, it gets stored in
the local repository. We can use the image
ls command to view the list of images in the local repository.
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.
Pulling Docker Images
In the previous post we executed the docker run command and noticed that the Docker Engine automatically pulled the hello-world image from DockerHub. We can also use the docker pull command to explicitly pull Docker images from the remote repository (DockerHub) to our local DockerRepository.
To pull images from the remote repository to the local repository we need to use the docker pull command as follows.Monday, September 14, 2020
Docker Desktop
Depending on the version of Windows operating system, we need to either install the Docker Toolkit or Docker Desktop. For Windows version less than 10, we cannot install Docker Desktop for these versions we need to install Docker Toolkit. For Windows 10 we can install Docker Desktop. It is recommended to install Docker Desktop.
Once Docker Desktop is installed, it will start and we can see an icon in the Toolbar.Installing Docker
To get started with using Docker we need to download and install the Docker setup. Docker can be installed in multiple platforms Windows / Mac / Linux. We can get the appropriate version of Docker from the below link and install it to get started.
Friday, September 11, 2020
What is Docker Network?
As the name suggests Docker network allows docker containers to communicate with other containers and with the outside world. Docker supports different types of Network configuration depending on the name of the Application / Docker container setup.
Monday, September 7, 2020
What is Docker Engine?
The Docker Engine is the
heart of the Docker platform, it consists of 2 main parts.
The Client
side (Docker CLI & Rest API) is used to fire commands
The Server side
(Docker Daemon) is used to process the commands and manages Containers.
What is Docker Hub?
Docker Hub is a service provided by Docker for finding and sharing container images. It allows us to push new images and pull existing images from the Hub. DockerHub is like GitHub we can user push/pull commands to manage Docker images. GitHub allows us to store and version controls our source code, while DockerHub allows us to store and version control Docker Images.
DockerHub is the default registry used by the Docker engine. DockerHub hosts public and private repositories, it also provides automated builds, organization accounts, and integration with source control solutions like Github and Bitbucket.
What is Docker Registry?
A Docker Registry is a storage and distribution system for named Docker images. The Docker registry is used to store the static Docker image templates. The same image might have multiple different versions, identified by their tags.
A Docker Registry is organized into Docker repositories, where a repository holds all the versions of a specific image. The registry allows Docker users to pull images locally, as well as push new images to the registry.
DockerHub is the default registry used by the Docker engine, it is the Docker's public registry instance. It is possible to run on-premise the open-source Docker registry/distribution, as well as a commercially supported version called Docker Trusted Registry
Sunday, September 6, 2020
What is Docker Daemon?
The Docker Engine has a client-server setup where can client can fire commands and the Server processes the commands to create and maintain live Docker Containers.
Docker Daemon is the server-side of the Docker Engine, all running Docker Containers are managed by the Docker Daemon. Docker CLI and API are the client-side of the Docker Engine which sends commands to the Docker Daemon. A daemon can also communicate with other daemons to manage Docker services.What is a Docker Image?
A Docker Image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries, and settings. A Container image is a static template version of a Docker Container, it is stored in the Docker registry.
Container images become containers at runtime and in the case of
Docker containers - images become containers when they run on Docker Engine.
When we execute the $ docker run command the container
image is fetched from the registry and loaded in the Docker Daemon server to
make it a live executing container.
Thursday, September 3, 2020
What is a Docker Container?
Docker Container vs Virtual Machine
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.