Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Hargun SE Exp-08

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Academic Year: 2023-24 Sap ID: 60003210174

Department of Information Technology

COURSE CODE: DJ19ITL602 DATE: 26-04-24


COURSE NAME: Software Engineering Laboratory CLASS: T.Y.BTech

EXPERIMENT NO. 8

CO/LO Analyze real world problem using software engineering principles.


AIM / OBJECTIVE: To install and configure Docker.
DESCRIPTION OF EXPERIMENT:
Introduction to docker:
Docker is an open platform for developing, shipping, and running applications. Docker enables
you to separate your applications from your infrastructure so you can deliver software quickly.
With Docker, you can manage your infrastructure in the same ways you manage your applications.
By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly,
you can significantly reduce the delay between writing code and running it in production.
Why is Docker used?
Docker is a basic tool, like git or java, that you should start incorporating into your daily
development and ops practices.
o Use Docker as version control system for your entire app's operating system o Use Docker
when you want to distribute/collaborate on your app's operating system with a team o Use
Docker to run your code on your laptop in the same environment as you have on your server
(try the building tool)
o Use Docker whenever your app needs to go through multiple phases of development
(dev/test/qa/prod, try Drone or Shippable, both do Docker CI/CD) o Use Docker with your Chef
Cookbooks and Puppet Manifests (remember, Docker doesn't do configuration management)
What role docker plays in dev-ops?
Docker is just another tool available to DevOps Engineers. What Docker does is it encapsulates
code and code dependencies in a single unit (a container) that can be run anywhere where the
Docker engine is installed.
Why is this useful?
Academic Year: 2023-24 Sap ID: 60003210174

Department of Information Technology

For multiple reasons; but in terms of CI/CD it can help Engineers separate Configuration from
Code, decrease the amount of time spent doing dependency management etc., can use it to scale
(with the help of some other tools of course). The list goes on. For example: If I had a single code
repository, in my build script I could pull in environment specific dependencies to create a
Container that functionally behaves the same in each environment, as I'm building from the same
source repository, but it can contain a set of environment specific certificates and configuration
files etc. Having said all of that, there really is a great deal you can do to utilize Docker in your
CI/CD Pipelines.
Containerization and its features:
Containers are made possible by operating system (OS) process isolation and virtualization, which
enable multiple application components to share the resources of a single instance of an OS kernel
in much the same way that machine virtualization enables multiple virtual machines (VMs) to
share the resources of a single hardware server. Containers offer all the benefits of VMs, including
application isolation, cost-effective scalability, and disposability. But the additional layer of
abstraction (at the OS level) offers important additional advantages: o Lighter weight: Unlike
VMs, containers don’t carry the payload of an entire OS instance—they include only the OS
processes and dependencies necessary to execute the code.
o Greater resource efficiency: With containers, you can run several times as many copies of
an application on the same hardware as you can using VMs. This can reduce your cloud spending.
o Improved developer productivity: Compared to VMs, containers are faster and easier to
deploy, provision, and restart. This makes them ideal for use in continuous integration and
continuous delivery (CI/CD) pipelines and a better fit for development teams adopting Agile and
DevOps practices.
What is docker image?
A Docker image is a read-only template that contains a set of instructions for creating a container that
can run on the Docker platform. It provides a convenient way to package up applications and
preconfigured server environments, which you can use for your own private use or share publicly
with other Docker users.
Is docker image and VM same?
Containers and virtual machines have similar resource isolation and allocation benefits, but
function differently because containers virtualize the operating system instead of hardware.
Academic Year: 2023-24 Sap ID: 60003210174

Department of Information Technology

Containers are more portable and efficient. Containers Virtual Machines Containers are an
abstraction at the app layer that packages code and dependencies together. Multiple containers can
run on the same machine and share the OS kernel with other containers, each running as isolated
processes in user space. Containers take up less space than VMs (container images are typically
tens of MBs in size), can handle more applications and require fewer VMs and Operating systems.
Virtual machines (VMs) are an abstraction of physical hardware turning one server into many
servers. The hypervisor allows multiple VMs to run on a single machine. Each VM includes a full
copy of an operating system, the application, necessary binaries and libraries - taking up tens of
GBs. VMs can also be slow to boot Steps of Installation:
• The following hardware prerequisites are required to successfully run WSL 2 on
Windows
10 or Windows 11: o 64-bit processor with Second Level Address Translation (SLAT) o
4GB system RAM o BIOS-level hardware virtualization support must be enabled in
the BIOS settings. For more information, see Virtualization.
• Download and install the Linux kernel update package.

Install Docker hub from https://docs.docker.com/docker-for-


windows/install/ and the follow the steps
Academic Year: 2023-24 Sap ID: 60003210174

Department of Information Technology


Academic Year: 2023-24 Sap ID: 60003210174

Department of Information Technology


Academic Year: 2023-24 Sap ID: 60003210174

Department of Information Technology

After installation in command prompt execute this command if you are getting error for linux kernel

Execute the first docker container using command given below


Academic Year: 2023-24 Sap ID: 60003210174

Department of Information Technology


Academic Year: 2023-24 Sap ID: 60003210174

Department of Information Technology

QUESTIONS:
1. Explain the concept of a Docker container and its key components.
2. How does Docker facilitate the development and deployment of applications?
OUTPUT:
Screenshots of every step
REFERNCE:
https://www.tutorialspoint.com/

You might also like