Docker is enterprise level container for securely building and sharing the images to be used across any on premises or cloud platform for the deployment. Examples of cloud platforms are Amazon AWS, Microsoft Azure, Google Cloud Platform.
Dockers are somewhat similar to Virtual Machines, but the difference is that instead of creating a operating systems, it helps us in using the same kernel of the linux. We need to add the application code or the
Docker enables us to use the same kernel of linux. We only need to add the build artifacts or the application data in the image.
Docker Images are created while we are running the Continuous Integration of the application.
Docker Images consists of the operating system and works on the virtualization. While working with the Continuous Integration we add our artifacts or the binaries for deployment on to the Docker Images.
Why to use Docker?
Now a days, all the software companies are building a lot of applications. So for the faster delivery, docker enables us to make faster delivery time to market.
Docker helps us in helping to deliver markets without any dependency on the Operating System or any hardware.
Docker enables us to create images that can be used for delivery a lot faster than any other methods.
Docker Compose is a tool for defining and deploying the multi container application.
Compose consists of the following commands that are used for managing the application life cycle:
Start, stop and rebuild services.
Viewing the status of running services.
Log the stream output for logging services.
Related Links:
Docker swarm vs Kubernets is one of the most important discussion between the engineers. Kubernets and Docker Swarm are container orchestration tool. In a micro-services based architecture, where there can be many docker images, we need to manage those images, so there was the need for orchestrating these images.
Docker helps us in containerizing the application. Docker are containers that contains the application within themselves. Latest versions of docker consists of the swarm mode which is native and is used to manage the docker engines.
What is docker?
What is Kubernetes?
Open source container orchestrator that automates deployment, scaling, and management of applications.
Features of Kubernets:
Installation | Initial Set Up is easy | Initial setup is hard |
Integration | Integrates easily with docker cli | Need to know kubernets cli with docker cli |
Nodes | Supports 2000+ | Supports 5000 |
GUI | No dashboard is available | Dashboard is available |
Load Balancing | Manual | Automatic |
Related Posts:
Visual Studio 2019 preview feature is available and we can download it from https://visualstudio.microsoft.com/downloads/
There are few interesting features that have been launched in new Visual Studio 2019.
Home Window has a completely new makeover. Now we have four options available in the home screen:
Checkout
OpenProject
OpenFromLocalFolder
Create a New Project
There are some improvements to search bar as well. Now, the search is very fast as compared to older version of windows. They also have included with code cleanup feature, that helps in refactoring the code.
StyleCop analysis the source code of the applications and creates code consistency for the application. Stylecop analyzers can be used in the below mentioned two ways:
1. First way, is by installing the stylecop analyzers visual studio extension.
2. Second way, is by using the stylecop.msbuild nuget package.
When upgrading from Windows 8 to Windows 10, there are some temporary or the backup files that are stored in the C Drive of the Windows Machine. There is a new folder created with a name of Windows.Old that is huge in size and is used for storing the old operating system. By default, windows delete those files after 10 days of upgrading.
Let’s say that you are running out of disc space and you want to delete this folder from your machine. Given below are the ways or the list of ways that can be used to delete the Windows.Old folder from your operating system.
1. Type Disk Clean-up in your search bar. You should be able to see the disk clean-up utility in the list.
2. Open the Disk Clean-up utility from windows.
3. Select C Drive from the drop down menu and click Ok button.
4. Click on the system files button.
5. After the disk clean-up has searched all the files and folders in the C#, it will give a list of files and folders that are available to clean-up from the C Drive.
6. You will find a file that says that Old Windows version.
7. Select the checkbox and click the OK button to clean-up the old windows files.
8. It takes around 20-30 minutes to clean up your old version of windows depending on the size of the file.
9. After the clean-up process is completed, you will be able to see that the Windows.Old folder has been deleted from your C Drive.
For more details:
Abstract Class are a type of class that does not have any implementation. A Abstract class is generally used as a base class. We cannot create any instance of an abstract class.
Structure is a value type but class is a reference type. Structures can store the value directory but classes hold the reference of the value you want to store.
Generics gives us the flexibility to change the value of return types at the run time. We can use <> brackets when declaring the objects. For Example: IList<T> lst =new List<T> where <T> is the return type.
Extension methods are used for extending the functionality of a currently existing function which you don’t have access to. Lets say that you have a dll where you want to add your functionality, so in this case you can extent the functionality of the dll using the extension methods. We use this for implementing the extension methods.
Overriding is implemented in c sharp using the Virtual and Override keywords, but in case of overloading we change the number of arguments or datatypes.
You may be interested in below interview questions:
Here are a list of top javascript programming interview questions.
What is javascript?
Javascript is a client side programming language that is used for editing the dom on the html page. Javascript helps in creating interactive web pages. Javascipt helps in creating animation in the webpages.
What are the different data types available in Javascript?
What are global variables in Javascript?
How are the global variables declared in Javascript?
Why is the use of this keyword in Javascript?
this keyword is used to denote the current instance of the object. The this keyword is used when we want to use a object within our function.
How do we use comments in Javascript?
There are two ways that we can implement comments in our application. They are single line comments and multi line comments. Single line of comments are useful when we want to comment a single line of code. // is used at the starting of the line. Multi line comments are used when we want to comment more than one line of code.We place /* at the starting and */ at the end of the line where you want to end the comment.
What is the meaning of undefined in Javascript?
How do we use javascript cookies?
How can we check the status of a checkbox?
What is prototyping in Javascript?
What is the difference between a null and undefined variable in javascript?
Here is the collection of most frequently asked top 50 Node js interview questions.
NodeJs is an opensource library available for creating server-side applications. It is built over the Chrome V8 platform.
Node Js is a javascript framework for writing server-side code for web applications. Node Js can be used to create rest APIs which can further be used in our UI front-end for getting data from the database.Why do we use require() in Node Js?
Module.export is used when you want to use any object, function into another NodeJs file.
Mocha is a testing framework in NodeJS which are used for creating unit test cases in NodeJS.
A promise in Node application is an action that can be either success or failure. If the web request is able to complete its promise then, its a success or its a failure. We can use chaining in promises.
We can use the testing framework like Mocha for testing the NodeJS applications
Mocha is a testing framework which is used for writing unit tests for Node Js application. Testing is one of the most important parts of any application development. There are many packages available for implementing testing in a node js application. One of the most common frameworks is Mocha. So, here I am going to show you how you can get started with testing a node js application.
So, let’s start by creating a simple node js application.
Step 1: Start a command prompt and create a new directory: mkdir nodejsapp
Step 2: Navigate to the folder: cd nodejsapp
Step 3: Run the command in command line: node init which creates a package.json file with default settings.
Step 4: Use Command Line to run: npm install mocha –save-dev
Step 5: Copy and paste the below code in your application:
mocha.js
module.exports.add = (x,y) =>{ return x+y-1; }
Step 6: Create a folder and create a file inside the folder with name as app.test.js
mocha.test.js
var mochaexample = require('./mochaexample'); it('should be sum of numbers',() => { var res = mochaexample.add(2,3); if(res !== 5){ throw new Error(`Result should be 5 but it is ${res}.`); } console.log("Test case passed.") })
Step 7: The final step is to add the mocha code into the script test section:
mocha ***/*.test.js
Once you have added the code into your project you can use the below command to start testing the application:
npm test
Below is a very simple way which we can use to auto restart our test cases. For achieving this we need to have nodemon package installed globally on our PC. Below is the npm command that can be used to install the nodemon package:
npm install nodemon
After installing the nodemon npm package replace the script for test with the script given below:
"scripts": { "test": "mocha ***/*.test.js", "test-watch": "ndeomon --exec \"npm test\"" }
Now to auto restart the tests you can use the below command:
npm run test-watch
Expect is an npm package that can be used with Mocha for writing the unit test cases in NodeJS. Here I am going to demonstrate how to expect can be used with Mocha for unit testing in the NodeJS application.
First of all you need to install the expect framework using the below command:
npm install --save-dev expect
After installing the package using the npm, you can replace the code as below
require('./mochaexample'); it('should be sum of numbers',() => { var res = mochaexample.add(2,3); //if(res !== 5){ // throw new Error(`Result should be 5 but it is ${res}.`); //} expect(res).toBe(5).toBeA('number'); })
One of the most common questions asked in the interviews is what is the difference between a singleton pattern and a static class. Given below are some of the points that show us the difference between the two:
Loaded automatically by the .NET Framework common language runtime (CLR) when the program or namespace containing the class is loaded.
Static Class cannot have a constructor.
You cannot create the instance of a static class.
We cannot pass the static class to a method.
We cannot inherit a Static class in C#.
Singleton instance is created for the first time when the user requested.
Singleton class can have a constructor.
You can create one instance of the object and reuse it.
You can create the object of singleton class and pass it to a method.
Singleton class does not say any restriction of Inheritance.
We can dispose the objects of a singleton class but not of static class.
Sign up for our newsletter to receive the latest news and event postings.
Recent Comments