We use cookies to provide you with a great user experience, analyze traffic and serve targeted promotions.   Learn More   Accept
How do you create a container in docker?

A container for a specified image can be created in docker by the below command:


> docker create [options] <image_name> <initial_command>

This command takes an existing docker image name as a parameter and returns a container_id for the created container. This container_id is used for working with the created container

Docker •  Added one month ago

What is meant by an image?

An image is a trimmed down version of operating system along with a specific set of resources pre-installed, which is downloaded from the docker repository and setup in the client machine (our machine) for use. In Docker, an image is used as a base in building a container which contains all the required dependencies along with the environment for the application to run without any hosting issues.

Docker •  Added one month ago

What is meant by a Container?

A container is an encapsulated environment which allows developer to pack all the necessary libraries and dependencies for running an application without any issues and deploy the entire container as an instance.

Docker •  Added one month ago

What are DQL commands?

DQL or Data Query Language commands are used for querying data from database objects. This is only a single command which can result in records from dbo such as tables, views etc and can be subject to projection.

SELECT [ DISTINCT column_1, column_2 .. | * ]
FROM <table_name>
WHERE <query_condition>
GROUP BY <columns_list>
HAVING <condition>
ORDER BY <columns_list> [ ASC | DESC ]

SQL •  Added 2 months ago

What are TCL commands?

TCL or Transaction Control Language commands are used to enforce control on transactions within a database object which might result in a change in the state of data within the dbo.

These are:

  • COMMIT
  • ROLLBACK [ TO save_point_name ]
  • SAVEPOINT save_point_name

SQL •  Added 2 months ago

What are DCL commands?

DCL or Data Control Language commands are used enforce access control to data within the database or database objects.

These are:

  • GRANT <previlige_name> ON <object_name> TO <user_name>
  • REVOKE <previlige_name> ON <object_name> FROM <user_name>

SQL •  Added 2 months ago

What are DML commands?

DML or Data Modification Language commands are used in creating, updating or deleting data from the database objects such as tables.

These are:

  • INSERT INTO TABLE <table_name>
  • UPDATE <table_name> SET <column_name>=<new_value>
  • DELETE [ <column_name> | * ] FROM <table_name>

SQL •  Added 2 months ago

What are DDL commands?

DDL or Data Definition Language commands are used in defining or manipulating database schema. These are used for creating, modifying, and dropping the structure of database objects such as tables.

These are:

  • CREATE TABLE | DATABASE <object_name>
  • ALTER TABLE <table_name>
  • DROP TABLE | DATABASE <object_name>

SQL •  Added 2 months ago

What are the different types of commands in SQL?

There are five types of commands in SQL based on the type of operation they perform:

  1. Data Definition Language - CREATE, ALTER, DROP
  2. Data Modification Language - INSERT, UPDATE, DELETE
  3. Data Control Language - GRANT, REVOKE
  4. Transaction Control Language - COMMIT, ROLLBACK, SAVEPOINT
  5. Data Query Language - SELECT

SQL •  Added 2 months ago

What is the full syntax of a SELECT query?

the full syntax of a SELECT query with all the possible CLAUSES is:


SELECT column_list | *
FROM table_name 
[ JOIN table_name1 ON join_condition ]
[ JOIN table_name2 ON join_condition .. ]
[ WHERE query_condition ]
[ GROUP BY group_by_column_list expression ]
[ HAVING query_condition ]
[ ORDER BY column_list [ ASC | DESC ]
 

SQL •  Added 2 months ago

What is the difference between ConfigureServices and Configure methods?
  • ConfigureServices() and Configure() methods are used to register services and configure components within the request pipeline respectively.
  • ConfigureServices() takes a parameter of type IServiceCollection.
  • Configure() takes a parameter of type IApplicationBuilder with possible parameters of any Service which is registered in the ConfigureServices() method.
  • an application should contain an ConfigureServices() method with an optional Configure() method.
public class Startup
{
    public void ConfigureServices(IServiceCollection services) 
    {
    }
    public void Configure(IApplicationBuilder app)
    {
    }
}

ASP.NET Core •  Added 2 months ago

How do you configure a middleware?

A logical component (a class or a method) can be configured into a middleware by registering it under the Configure() method of the Startup class. It can be done as below.

app.UseMiddleware<MyClass>();

for a class which takes a constructor parameter of RequestDelegate and uses it to navigate to next component, or a simple method delegate within the Configure method as.

app.Use(async (context, next) => {
    // some logic
    await next.Invoke();
});

ASP.NET Core •  Added 2 months ago

What is a middleware?

A middleware is a logical component that sits on the path of a request-response pipeline and is invoked for every request to execute a particular responsibility / functionality on that request. It has access to the HttpContext of the current request and so can be able to validate or reject an incoming request for some condition.

In ASP.NET Core, all the components of the framework such as controllers, authorizers and loggers are internally executed as middlewares.

Developers can also define and include own logical components to be executed to validate or emphasize on an incoming request by registering these as middlewares.

ASP.NET Core •  Added 2 months ago

What is the difference between a Transient and a Scoped service?

A Transient service instance is created every time a calling method or dependent class requests for it from the container, whereas a Scoped service instance is created for a request and is reused by the container for all calling methods or classes within that request. Hence a Scoped service has a create-once-per-request scope while the Transient has a create-once-per-service-invoke scope.

ASP.NET Core •  Added 2 months ago

What is the difference between a Singleton and a Transient service?

A Singleton service instance once created is reused for the entire application lifetime, whereas a Transient service instance is created every time a calling method or dependent class requests for it from the container.

ASP.NET Core •  Added 2 months ago