Software Testing: Manual vs Automation
Software Testing: Manual vs Automation
Unit – 5
Testing Tools and automation
If we want to ensure that our software is bug-free or stable, we must perform the
various types of software testing because testing is the only method that makes
our application bug-free.
The purpose of having a testing type is to confirm the AUT (Application Under
Test).
The software testing mainly divided into two parts, which are as follows:
o Manual Testing
o Automation Testing
Prepared by Jagan Mohan
We do not require any precise knowledge of any testing tool to execute the
manual test cases. We can easily prepare the test document while performing
manual testing on any application.
In software testing, manual testing can be further classified into three different
types of testing, which are as follows:
In white-box testing, the developer will inspect every line of code before
handing it over to the testing team or the concerned test engineers.
In other words, we can say that the developer will execute the complete white-
box testing for the particular software and send the specific application to the
testing team.
The purpose of implementing the white box testing is to emphasize the flow of
inputs and outputs over the software and enhance the security of an application.
White box testing is also known as open box testing, glass box testing,
structural testing, clear box testing, and transparent box testing.
Another type of manual testing is black-box testing. In this testing, the test
engineer will analyze the software against requirements, identify the defects or
bug, and sends it back to the development team.
Then, the developers will fix those defects, do one round of White box testing,
and send it to the testing team.
Prepared by Jagan Mohan
Here, fixing the bugs means the defect is resolved, and the particular feature is
working according to the given requirement.
The main objective of implementing the black box testing is to specify the
business needs or the customer's requirements.
In other words, we can say that black box testing is a process of checking the
functionality of an application as per the customer requirement. The source code
is not visible in this testing; that's why it is known as black-box testing.
Black box testing further categorizes into two parts, which are as discussed
below:
o Functional Testing
o Non-function Testing
Prepared by Jagan Mohan
Functional Testing
The test engineer will check all the components systematically against
requirement specifications is known as functional testing. Functional testing is
also known as Component testing.
In functional testing, all the components are tested by giving the value, defining
the output, and validating the actual output with the expected value.
Just like another type of testing is divided into several parts, functional testing is
also classified into various categories.
o Unit Testing
o Integration Testing
o System Testing
Prepared by Jagan Mohan
1. Unit Testing
Unit testing is the first level of functional testing in order to test any software. In
this, the test engineer will test the module of an application independently or
test all the module functionality is called unit testing.
The primary objective of executing the unit testing is to confirm the unit
components with their performance. Here, a unit is defined as a single testable
function of a software or an application. And it is verified throughout the
specified application development phase.
2. Integration Testing
o Incremental Testing
o Non-Incremental Testing
If these modules are working fine, then we can add one more module and test
again. And we can continue with the same process to get better results.
In other words, we can say that incrementally adding up the modules and test
the data flow between the modules is known as Incremental integration
testing.
Prepared by Jagan Mohan
Incremental integration testing can further classify into two parts, which are as
follows:
In this approach, we will add the modules step by step or incrementally and test
the data flow between them. We have to ensure that the modules we are adding
are the child of the earlier ones.
In the bottom-up approach, we will add the modules incrementally and check
the data flow between modules. And also, ensure that the module we are adding
is the parent of the earlier ones.
Whenever the data flow is complex and very difficult to classify a parent and a
child, we will go for the non-incremental integration approach. The non-
incremental method is also known as the Big Bang method.
3. System Testing
Whenever we are done with the unit and integration testing, we can proceed
with the system testing.
In this type of testing, we will undergo each attribute of the software and test if
the end feature works according to the business requirement. And analysis the
software product as a complete system.
Prepared by Jagan Mohan
Non-function Testing
Non-functional testing will help us minimize the risk of production and related
costs of the software.
o Performance Testing
o Usability Testing
o Compatibility Testing
1. Performance Testing
In performance testing, the test engineer will test the working of an application
by applying some load.
In this type of non-functional testing, the test engineer will only focus on
several aspects, such as Response time, Load, scalability, and Stability of the
software or an application.
Performance testing includes the various types of testing, which are as follows:
o Load Testing
o Stress Testing
o Scalability Testing
o Stability Testing
o Load Testing
Prepared by Jagan Mohan
While executing the performance testing, we will apply some load on the
particular application to check the application's performance, known as load
testing. Here, the load could be less than or equal to the desired load.
It will help us to detect the highest operating volume of the software and
bottlenecks.
o Stress Testing
Primarily, stress testing is used for critical software, but it can also be used for
all types of software applications.
o Scalability Testing
o Stability Testing
It mainly checks the constancy problems of the application and the efficiency of
a developed product. In this type of testing, we can rapidly find the system's
defect even in a stressful situation.
2. Usability Testing
o The application should be easy to understand, which means that all the
features must be visible to end-users.
o The application's look and feel should be good that means the application
should be pleasant looking and make a feel to the end-user to use it.
3. Compatibility Testing
Here, software means we can test the application on the different operating
systems and other browsers, and hardware means we can test the application
on different sizes.
Since, the grey box testing includes access to internal coding for designing test
cases. Grey box testing is performed by a person who knows coding as well as
testing.
In other words, we can say that if a single-person team done both white box
and black-box testing, it is considered grey box testing.
Prepared by Jagan Mohan
Automation Testing
Automation testing is the best way to enhance the efficiency, productivity, and
coverage of Software testing.
It is used to re-run the test scenarios, which were executed manually, quickly,
and repeatedly.
In other words, we can say that whenever we are testing an application by using
some tools is known as automation testing.
In software testing, we also have some other types of testing that are not part of
any above discussed testing, but those testing are required while testing any
software or an application.
o Smoke Testing
o Sanity Testing
o Regression Testing
o User Acceptance Testing
o Exploratory Testing
o Adhoc Testing
o Security Testing
o Globalization Testing
In smoke testing, we will test an application's basic and critical features before
doing one round of deep and rigorous testing.
Prepared by Jagan Mohan
Or before checking all possible positive and negative values is known as smoke
testing. Analyzing the workflow of the application's core and main functions is
the main objective of performing the smoke testing.
Sanity Testing
It is used to ensure that all the bugs have been fixed and no added issues come
into existence due to these changes. Sanity testing is unscripted, which means
we cannot document it. It checks the correctness of the newly added features
and components.
Regression Testing
Regression testing is the most commonly used type of software testing. Here,
the term regression implies that we have to re-test those parts of an unaffected
application.
Regression testing is the most suitable testing for automation tools. As per the
project type and accessibility of resources, regression testing can be similar
to Retesting.
Whenever a bug is fixed by the developers and then testing the other features of
the applications that might be simulated because of the bug fixing is known
as regression testing.
In other words, we can say that whenever there is a new release for some
project, then we can perform Regression Testing, and due to a new feature may
affect the old features in the earlier releases.
The User acceptance testing (UAT) is done by the individual team known as
domain expert/customer or the client. And knowing the application before
accepting the final product is called as user acceptance testing.
Exploratory Testing
Whenever the requirement is missing, early iteration is required, and the testing
team has experienced testers when we have a critical application. New test
engineer entered into the team then we go for the exploratory testing.
To execute the exploratory testing, we will first go through the application in all
possible ways, make a test document, understand the flow of the application,
and then test the application.
Adhoc Testing
Testing the application randomly as soon as the build is in the checked sequence
is known as Adhoc testing.
It is also called Monkey testing and Gorilla testing. In Adhoc testing, we will
check the application in contradiction of the client's requirements; that's why it
is also known as negative testing.
When the end-user using the application casually, and he/she may detect a bug.
Still, the specialized test engineer uses the software thoroughly, so he/she may
not identify a similar detection.
Security Testing
The execution of security testing will help us to avoid the nasty attack from
outsiders and ensure our software applications' security.
In other words, we can say that security testing is mainly used to define that the
data will be safe and endure the software's working process.
Globalization Testing
Globalization testing is used to make sure that the application will support
multiple languages and multiple features.
Conclusion
In the tutorial, we have discussed various types of software testing. But there is
still a list of more than 100+ categories of testing. However, each kind of testing
is not used in all types of projects.
These testing types, processes, and execution approaches keep changing when
the project, requirements, and scope change.
Selenium Introduction
Selenium is one of the most widely used open source Web UI (User Interface)
automation testing suite. It was originally developed by Jason Huggins in 2004
as an internal tool at Thought Works. Selenium supports automation across
different browsers, platforms and programming languages.
Languages supported by Selenium include C#, Java, Perl, PHP, Python and
Ruby.
Currently, Selenium Web driver is most popular with Java and C#. Selenium
test scripts can be coded in any of the supported programming languages and
can be run directly in most modern web browsers. Browsers supported by
Selenium include Internet Explorer, Mozilla Firefox, Google Chrome and
Safari.
Selenium can be used to automate functional tests and can be integrated with
automation test tools such as Maven, Jenkins, & Docker to achieve continuous
testing. It can also be integrated with tools such as TestNG, & JUnit for
managing test cases and generating reports.
Prepared by Jagan Mohan
Selenium Features
JavaScript testing
Test suites: A test suite is a collection of related tests that are grouped together.
The purpose of a test suite is to test a specific aspect of the code in isolation.
Test cases: A test case is a single test that verifies a specific aspect of the code.
For example, a test case might check that a function behaves correctly when
given a certain input.
Test runners: A test runner is a tool that runs the tests and provides feedback
on the results. Test runners typically provide a report on which tests passed and
which tests failed.
The goal of JavaScript testing is to catch bugs and defects early in the
development cycle, before they become bigger problems and impact the quality
of the software. Testing also helps to ensure that the code behaves as expected,
even when changes are made in the future.
There are different types of tests that can be performed in JavaScript, including
unit tests, integration tests, and end-to-end tests. The choice of which tests to
write depends on the specific requirements and goals of the project.
Prepared by Jagan Mohan
The term backend generally refers to server-side deployment. Here the process
is entirely happening in the backend which is not shown to the user only the
expected results will be shown to the user. In every web application, there will
be a backend language to accomplish the task.
For Example, while uploading the details of the students in the database, the
database will store all the details. When there is a need to display the details of
the students, it will simply fetch all the details and display them. Here, it will
show only the result, not the process and how it fetches the details.
1. Structural Testing
Structural testing is the process of validating all the elements that are present
inside the data repository and are primarily used for data storage. It involves
checking the objects of front-end developments with the database mapping
objects.
Types of Structural Testing: The following are the different types of structural
testing:
a) Schema Testing: In this Schema Testing, the tester will check for the
correctly mapped objects. This is also known as mapping testing. It
ensures whether the objects of the front-end and the objects of the back-
Prepared by Jagan Mohan
b) Table and Column Testing: In this, it ensures that the table and column
properties are correctly mapped.
● It ensures whether the table and the column names are correctly mapped on
both the front-end side and server-side.
● It validates the datatype of the column is correctly mentioned.
● It ensures the correct naming of the column values of the database.
● It detects the unused tables and columns.
● It validates whether the users are able to give the correct input as per the
requirement.
For example, if we mention the wrong datatype for the column on the server-
side which is different from the front-end then it will raise an error.
c) Key and Indexes Testing: In this, it validates the key and indexes of the
columns.
● It ensures whether the mentioned key constraints are correctly provided. For
example, Primary Key for the column is correctly mentioned as per the given
requirement.
● It ensures the correct references of Foreign Key with the parent table.
● It checks the length and size of the indexes.
● It ensures the creation of clustered and non-clustered indexes for the table as
per the requirement.
● It validates the naming conventions of the Keys.
d) Trigger Testing: It ensures that the executed triggers are fulfilling the
required conditions of the DML transactions.
● It validates whether the triggers make the data updates correctly when we
have executed them.
● It checks the coding conventions are followed correctly during the coding
phase of the triggers.
● It ensures that the trigger functionalities of update, delete, and insert.
e) Stored Procedures Testing: In this, the tester checks for the correctness of
the stored procedure results.
● It checks whether the stored procedure contains the valid conditions for
looping and conditional statements as per the requirement.
● It validates the exception and error handling in the stored procedure.
Prepared by Jagan Mohan
2. Functional Testing
● Errors in the queries can also be handled in this white box testing and hence
internal errors are easily eliminated.
3. Non-Functional Testing
1. Set up the Test Environment: When the coding process is done for the
application, set up the test environment by choosing a proper testing tool for
back-end testing. It includes choosing the right team to test the entire back-end
environment with a proper schedule. Record all the testing processes in the
documents or update them in software to keep track of all the processes.
2. Generate the Test Cases: Once the tool and the team are ready for the
testing process, generate the test cases as per the business requirements. The
automation tool itself will analyze the code and generate all possible test cases
for developed code. If the process is manual then the tester will have to write
the possible test cases in the testing tool to ensure the correctness of the code.
3. Execution of Test Cases: Once the test cases are generated, the tester or
Quality Analyst needs to execute those test cases in the developed code. If the
tool is automated, it will generate and execute the test cases by itself. Otherwise,
the tester needs to write and execute those test cases. It will highlight whether
the execution of test cases is executed successfully or not.
Prepared by Jagan Mohan
4. Analyzing the Test Cases: After the execution of test cases, it highlights the
result of all the test cases whether it has been executed successfully or not. If an
error occurs in the test cases, it will highlight where the particular error is
formed or raised, and in some cases, the automation tool will give hints
regarding the issues to solve the error. The tester or Quality Analyst should
analyze the code again and fix the issues if an error occurred.
5. Submission of Test Reports: This is the last stage in the testing process.
Here, all the details such as who is responsible for testing, the tool used in the
testing process, number of test cases generated, number of test cases executed
successfully or not, time is taken to execute each test case, number of times test
cases failed, number of times errors occurred. These details are either
documented or updated in the software. The report will be submitted to the
respective team.
The following are some of the factors for backend testing validation:
● Performance Check: It validates the performance of each individual test
and the system behaviour.
● Sequence Testing: Backend testing validates that the tests are distributed
according to the priority.
● Database Server Validations: In this, ensures that the data fed through for
the tests is correct or not.
● Functions Testing: In this, the test validates the consistency in transactions
of the database.
● Key and Indexes: In this, the test ensures that the accurate constraint and
the rules of constraints and indexes are followed properly.
● Data Integrity Testing: It is a technique in which data is verified in the
database whether it is accurate and functions as per requirements.
● Database Tables: It ensures that the created table and the queries for the
output are providing the expected result.
● Database Triggers: Backend Testing validates the correctness of the
functionality of triggers.
● Stored Procedures: Backend testing validates the functions, return
statements, calling the other events, etc., are correctly mentioned as per the
requirements,
Prepared by Jagan Mohan
6. SQLMap:
● It is an open-source tool.
● It is used for performing Penetration Testing to automate the process of
detection.
● Powerful detection of errors will lead to efficient testing and result in the
expected behaviour of the requirements.
7. phpMyadmin:
● This is the software tool and it is written in PHP.
● It is developed to handle the databases and we can execute test queries to
ensure the correctness of the result as a whole and even for a separate table.
8. Automatic Efficient Test Generator (AETG):
● It mechanically generates the possible tests from user-defined requirements.
● It is based on algorithms that use ideas from statistical experimental design
theory to reduce the number of tests needed for a specific level of test
coverage of the input test space.
9. Hammer DB:
● It is an open-source tool for load testing.
● It validates the activity replay functionality for the oracle database.
● It is based on industry standards like TPC-C and TPC-H Benchmarks.
10. SQL Test:
● SQL Test uses an open-source tSQLt framework, views, stored procedures,
and functions.
● This tool stores database object in a separate schema and if changes occur
there is no need for clearing the process.
● It allows running the unit test cases for the SQL server database.
● While doing the backend testing, the errors in the UI parts can also be
detected and replaced.
● Coverage of all possible test cases.
Test-driven development
Test-Driven Development starts with designing and developing tests for every
small functionality of an application. TDD framework instructs developers to
write new code only if an automated test has failed. This avoids duplication of
code. The TDD full form is Test-driven development.
Prepared by Jagan Mohan
The simple concept of TDD is to write and correct the failed tests before writing
new code (before development). This helps to avoid duplication of code as we
write a small amount of code at a time in order to pass tests. (Tests are nothing
but requirement conditions that we need to test to full fill them).
1. Add a test.
2. Run all tests and see if any new test fails.
3. Write some code.
4. Run tests and Refactor code.
5. Repeat
Prepared by Jagan Mohan
Below is the main difference between Test driven development and traditional
testing:
● In TDD, you achieve 100% coverage test. Every single line of code is
tested, unlike traditional testing.
● The combination of both traditional testing and TDD leads to the
importance of testing the system rather than perfection of the system.
● In Agile Modeling (AM), you should “test with a purpose”. You should
know why you are testing something and what level its need to be tested.
2. Developer TDD: With Developer TDD you write single developer test
i.e. unit test and then just enough production code to fulfill that test. The
unit test focuses on every small functionality of the system. Developer
TDD is simply called as TDD. The main goal of ATDD and TDD is to
specify detailed, executable requirements for your solution on a just in
time (JIT) basis. JIT means taking only those requirements in
consideration that are needed in the system. So increase efficiency.
Prepared by Jagan Mohan
REPL-driven development
Virtualization stacks
In DevOps, code execution at the client refers to the process of executing code
or scripts on client devices or machines. This can be accomplished in several
ways, including:
Mobile apps: Mobile applications can also run code on client devices, allowing
developers to create dynamic, interactive experiences for users.
Puppet Architecture
Puppet Master
Puppet master handles all the configuration related process in the form of
puppet codes. It is a Linux based system in which puppet master software is
installed. The puppet master must be in Linux. It uses the puppet agent to apply
the configuration to nodes.
This is the place where SSL certificates are checked and marked.
Puppet agents are the real working systems and used by the Client. It is installed
on the client machine and maintained and managed by the puppet master. They
have a puppet agent service running inside them.
Config Repository
Config repository is the storage area where all the servers and nodes related
configurations are stored, and we can pull these configurations as per
requirements.
Facts
Facts are the key-value data pair. It contains information about the node or the
master machine. It represents a puppet client states such as operating system,
network interface, IP address, uptime, and whether the client machine is virtual
or not.
These facts are used for determining the present state of any agent. Changes on
any target machine are made based on facts. Puppet's facts are predefined and
customized.
Catalog
The entire configuration and manifest files that are written in Puppet are
changed into a compiled format. This compiled format is known as a catalog,
and then we can apply this catalog to the target machine.
Prepared by Jagan Mohan
o First of all, an agent node sends facts to the master or server and requests
for a catalog.
o The master or server compiles and returns the catalog of a node with the
help of some information accessed by the master.
o Then the agent applies the catalog to the node by checking every resource
mentioned in the catalog. If it identifies resources that are not in their
desired state, then makes the necessary adjustments to fix them. Or, it
determines in no-op mode, the adjustments would be required to
reconcile the catalog.
o And finally, the agent sends a report back to the master.
o Puppet slave sends the requested slave certificate to the puppet master.
o Puppet slave sends a request for data to the puppet master.
o Finally, the master sends the data to the puppet slave as per the request.
Puppet Blocks
Puppet provides the flexibility to integrate Reports with third-party tools using
Puppet APIs.
1. Resources
2. Classes
3. Manifest
4. Modules
Puppet Resources:
Puppet Resources are the building blocks of Puppet.
Resources are the inbuilt functions that run at the back end to perform the
required operations in puppet.
Puppet Classes:
A combination of different resources can be grouped together into a single unit
called class.
Puppet Manifest:
Manifest is a directory containing puppet DSL files. Those files have a .pp
extension. The .pp extension stands for puppet program. The puppet code
consists of definitions or declarations of Puppet Classes.
Puppet Modules:
Modules are a collection of files and directories such as Manifests, Class
definitions. They are the re-usable and sharable units in Puppet.
For example, the MySQL module to install and configure MySQL or the
Jenkins module to manage Jenkins, etc..
Prepared by Jagan Mohan
Ansible:
when finished. Ansible manages your inventory in simple text files (These are
the hosts file). Ansible uses the hosts file where one can group the hosts and can
control the actions on a specific group in the playbooks.
Sample Hosts File
This is the content of hosts file −
#File name: hosts
#Description: Inventory file for your application. Defines machine type abc
node to deploy specific artifacts
# Defines machine type def node to upload
metadata.
[abc-node]
#server1 ansible_host = <target machine for DU deployment> ansible_user =
<Ansible
user> ansible_connection = ssh
server1 ansible_host = <your host name> ansible_user = <your unix user>
ansible_connection = ssh
[def-node]
#server2 ansible_host = <target machine for artifact upload>
ansible_user = <Ansible user> ansible_connection = ssh
server2 ansible_host = <host> ansible_user = <user> ansible_connection = ssh
Prepared by Jagan Mohan
Ansible Workflow
Ansible works by connecting to your nodes and pushing out a small program
called Ansible modules to them. Then Ansible executed these modules and
removed them after finished. The library of modules can reside on any machine,
and there are no daemons(API requests and manage objects such as
images,containers,networks), servers, or databases required.
Prepared by Jagan Mohan
In the above image, the Management Node is the controlling node that controls
the entire execution of the playbook. The inventory file provides the list of
hosts where the Ansible modules need to be run. The Management
Node makes an SSH(Secure shell) connection and executes the small modules
on the host's machine and install the software.
Ansible removes the modules once those are installed so expertly. It connects to
the host machine executes the instructions, and if it is successfully installed,
then remove that code in which one was copied on the host machine.
Terms Explanation
Ansible It is a machine where Ansible is installed and from which all tasks
Server and playbooks will be executed.
Fact The information fetched from the client system from the global
variables with the gather facts operation.
Notifier The section attributed to a task which calls a handler if the output is
changed.
Tag It is a name set to a task that can be used later on to issue just that
specific task or group of jobs.
Ansible Architecture
The Ansible orchestration engine interacts with a user who is writing the
Ansible playbook to execute the Ansible orchestration and interact along with
the services of private or public cloud and configuration management database.
You can show in the below diagram, such as:
Inventory
API's
The Ansible API's works as the transport for the public or private cloud
services.
Prepared by Jagan Mohan
Modules
Ansible connected the nodes and spread out the Ansible modules programs.
Ansible executes the modules and removed after finished. These modules can
reside on any machine; no database or servers are required here. You can work
with the chose text editor or a terminal or version control system to keep track
of the changes in the content.
Plugins
Plugins is a piece of code that expends the core functionality of Ansible. There
are many useful plugins, and you also can write your own.
Playbooks
Playbooks consist of your written code, and they are written in YAML format,
which describes the tasks and executes through the Ansible. Also, you can
launch the tasks synchronously and asynchronously with playbooks.
Hosts
In the Ansible architecture, hosts are the node systems, which are automated by
Ansible, and any machine such as RedHat, Linux, Windows, etc.
Networking
Ansible is used to automate different networks, and it uses the simple, secure,
and powerful agentless automation framework for IT operations and
development. It uses a type of data model which separated from the Ansible
automation engine that spans the different hardware quite easily.
Cloud
A cloud is a network of remote servers on which you can store, manage, and
process the data. These servers are hosted on the internet and storing the data
remotely rather than the local server. It just launches the resources and instances
on the cloud, connect them to the servers, and you have good knowledge of
operating your tasks remotely.
Prepared by Jagan Mohan
CMDB
Deployment tools
Chef
Why Chef?
Features of Chef
Advantages of Chef
Prepared by Jagan Mohan
Disadvantages of Chef
Resource
It is the basic component of a recipe used to manage the infrastructure with
different kind of states. There can be multiple resources in a recipe, which will
help in configuring and managing the infrastructure. For example −
● package − Manages the packages on a node
● service − Manages the services on a node
● user − Manages the users on the node
● group − Manages groups
● template − Manages the files with embedded Ruby template
● cookbook_file − Transfers the files from the files subdirectory in the
cookbook to a location on the node
● file − Manages the contents of a file on the node
● directory − Manages the directories on the node
● execute − Executes a command on the node
● cron − Edits an existing cron file on the node
Chef - Architecture
● Chef works on a three-tier client server model wherein the working units
such as cookbooks are developed on the Chef workstation. From the
command line utilities such as knife, they are uploaded to the Chef server
and all the nodes which are present in the architecture are registered with
the Chef server.
Prepared by Jagan Mohan
Salt Stack
Benefits of SaltStack
Being simple as well as a feature-rich system, Salt provides many benefits and
they can be summarized as below −
● Robust − Salt is powerful and robust configuration management
framework and works around tens of thousands of systems.
● Authentication − Salt manages simple SSH key pairs for authentication.
● Secure − Salt manages secure data using an encrypted protocol.
● Fast − Salt is very fast, lightweight communication bus to provide the
foundation for a remote execution engine.
● Virtual Machine Automation − The Salt Virt Cloud Controller
capability is used for automation.
● Infrastructure as data, not code − Salt provides a simple deployment,
model driven configuration management and command execution
framework.
Introduction to ZeroMQ
Prepared by Jagan Mohan
SaltStack – Architecture
Features of Docker
Components of Docker
Docker architecture
● Docker uses a client-server architecture. The Docker client talks to the
Docker daemon, which does the heavy lifting of building, running, and
distributing your Docker containers. The Docker client and
daemon can run on the same system, or you can connect a Docker client
to a remote Docker daemon. The Docker client and daemon communicate
using a REST API, over UNIX sockets or a network interface. Another
Docker client is Docker Compose, that lets you work with applications
consisting of a set of containers.
Docker Desktop
Docker Desktop is an easy-to-install application for your Mac, Windows or
Linux environment that enables you to build and share containerized
applications and microservices. Docker Desktop includes the Docker daemon
(dockerd), the Docker client (docker), Docker Compose, Docker Content Trust,
Kubernetes, and Credential Helper. For more information, see Docker Desktop.
Docker registries
A Docker registry stores Docker images. Docker Hub is a public registry that
anyone can use, and Docker is configured to look for images on Docker Hub by
default. You can even run your own private registry.
When you use the docker pull or docker run commands, the required images are
pulled from your configured registry. When you use the docker push command,
your image is pushed to your configured registry.
Docker objects
When you use Docker, you are creating and using images, containers, networks,
volumes, plugins, and other objects. This section is a brief overview of some of
those objects.
Images
An image is a read-only template with instructions for creating a Docker
container. Often, an image is based on another image, with some additional
customization. For example, you may build an image which is based on
the ubuntu image, but installs the Apache web server and your application, as
well as the configuration details needed to make your application run.
You might create your own images or you might only use those created by
others and published in a registry. To build your own image, you create
a Dockerfile with a simple syntax for defining the steps needed to create the
Prepared by Jagan Mohan
image and run it. Each instruction in a Dockerfile creates a layer in the image.
When you change the Dockerfile and rebuild the image, only those layers which
have changed are rebuilt. This is part of what makes images so lightweight,
small, and fast, when compared to other virtualization technologies.
Containers
A container is a runnable instance of an image. You can create, start, stop,
move, or delete a container using the Docker API or CLI. You can connect a
container to one or more networks, attach storage to it, or even create a new
image based on its current state.
By default, a container is relatively well isolated from other containers and its
host machine. You can control how isolated a container’s network, storage, or
other underlying subsystems are from other containers or from the host
machine.
1. If you do not have the ubuntu image locally, Docker pulls it from your
configured registry, as though you had run docker pull ubuntu manually.
2. Docker creates a new container, as though you had run a docker container
create command manually.
3. Docker allocates a read-write filesystem to the container, as its final
layer. This allows a running container to create or modify files and
directories in its local filesystem.
5. Docker starts the container and executes /bin/bash. Because the container
is running interactively and attached to your terminal (due to the -i and -
t flags), you can provide input using your keyboard while the output is
logged to your terminal.
6. When you type exit to terminate the /bin/bash command, the container
stops but is not removed. You can start it again or remove it.