0% found this document useful (0 votes)
4 views

Experiment 4

The document outlines an experiment on Docker, focusing on its installation on Linux and Windows, and the creation of containers. It highlights Docker's benefits such as environment consistency, portability, resource efficiency, scalability, and isolation. The expected outcomes include successful installation, container creation, management, and deployment consistency, along with a conclusion emphasizing Docker's role in efficient application development and deployment.

Uploaded by

VIDIT SHAH
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Experiment 4

The document outlines an experiment on Docker, focusing on its installation on Linux and Windows, and the creation of containers. It highlights Docker's benefits such as environment consistency, portability, resource efficiency, scalability, and isolation. The expected outcomes include successful installation, container creation, management, and deployment consistency, along with a conclusion emphasizing Docker's role in efficient application development and deployment.

Uploaded by

VIDIT SHAH
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Somaiya Vidyavihar University

K. J. Somaiya College of Engineering, Mumbai-77


Department of Computer Engineering

Batch: Roll No.: 16030724019


Experiment / assignment / tutorial
No.___3____
Grade: AA / AB / BB / BC / CC / CD /DD
Signature of the Staff In-charge with date

Experiment No: 4
Title: Docker
Aim and Objective of the Experiment:
Aim: Docker – Container - Installation of Docker on Linux / Windows and creating
Containers
Objective :
• Environment Consistency: Docker allows applications to run consistently across different
environments, avoiding compatibility issues.
• Portability: Containers can run on any system with Docker installed, making applications
easy to transfer and deploy.
• Resource Efficiency: Containers share the OS kernel and have minimal overhead, allowing
efficient use of resources.
• Scalability: Containers are ideal for scaling applications horizontally by creating multiple
instances as needed.
• Isolation: Containers run in isolated environments, ensuring security and minimizing
interference between applications.

COs to be achieved:
1. Installing Docker
2. Creating container in docker
Somaiya Vidyavihar University
K. J. Somaiya College of Engineering, Mumbai-77
Department of Computer Engineering

Expected Outcome of Experiment

1. Successful Installation of Docker:

• Linux: Docker is successfully installed, with the Docker daemon running and enabled at
startup.
• Windows: Docker Desktop installs successfully, launches without errors, and is
integrated with WSL 2 if on Windows 10/11.

Expected output should display the Docker version installed.

2. Creation and Operation of Containers:

• Container Creation: When a container is created using an image (e.g., Ubuntu), it


should start without errors.
• Container Interaction: Commands like docker run -it ubuntu should open an
interactive shell inside the container.
• Isolation: Applications and processes inside containers should operate in an isolated
environment, unaffected by the host OS or other containers.

3. Running and Managing Containers:

• Running Containers: Using docker ps, you should see a list of running containers
with details like container ID, image name, and status.
• Stop and Start: Commands like docker stop <container_id> and docker start
<container_id> should operate as expected, allowing you to control container
lifecycle.
• Efficient Resource Use: Containers should use system resources efficiently, showing
low overhead when multiple containers are run concurrently.

4. Deployment Consistency:

• Portability: Created containers should run identically on any system where Docker is
installed, allowing for consistent deployment across environments.
• Reproducibility: By pulling the same image and running it, the application setup should
be consistent and reproducible on different systems.

5. Scalability and Flexibility:

• You should be able to quickly scale applications by creating multiple instances of


containers as needed, making it easier to handle varying load requirements.
Somaiya Vidyavihar University
K. J. Somaiya College of Engineering, Mumbai-77
Department of Computer Engineering

Related Theory:
Docker is a platform that uses OS-level virtualization to deliver software in packages called
containers. Containers are lightweight, standalone, executable software packages that
include everything needed to run an application, including code, runtime, libraries, and
configurations.
Docker

Docker is an open-source platform that allows developers to automate the deployment of


applications inside lightweight, isolated environments called containers.

Key Concepts in Docker:

1. Containers: Lightweight, standalone executable units that package an application with


all its dependencies, including libraries, binaries, and configuration files. Containers are
isolated from each other and the host system, making them portable across different
environments.
2. Images: Templates used to create containers. An image is a pre-configured package that
includes everything the application needs to run. Docker images can be created from a
Dockerfile, which specifies the base image, environment setup, dependencies, and
commands to run.
3. Dockerfile: A script that contains instructions for Docker on how to build an image. It
outlines the base image, environment configurations, dependencies, and the
application’s start command.
4. Docker Hub: A public repository where Docker images can be shared and accessed by
others. Developers can pull images from Docker Hub or push their own.

Why Use Docker?

• Portability: Docker containers can run on any machine with Docker installed, providing
a consistent environment across development, testing, and production.
• Resource Efficiency: Containers share the same OS kernel, making them more
lightweight than traditional virtual machines.
• Scalability: Docker makes it easy to scale applications horizontally by adding more
containers.

Python

Python is a high-level, interpreted programming language known for its simplicity and
versatility. It's widely used in web development, data science, machine learning, automation,
and more.

Key Features of Python:

1. Easy Syntax: Python's syntax is clean and simple, making it accessible for beginners
and efficient for experienced developers.
2. Rich Standard Library and Ecosystem: Python has a large standard library and a vast
ecosystem of third-party libraries (e.g., NumPy, Pandas, Django, Flask) that extend its
functionality for a variety of tasks.
3. Cross-Platform Compatibility: Python code can run on any operating system with a
Python interpreter (e.g., Windows, macOS, Linux).
Somaiya Vidyavihar University
K. J. Somaiya College of Engineering, Mumbai-77
Department of Computer Engineering

4. Dynamic Typing: Python uses dynamic typing, which means variables don’t need
explicit type declaration, improving development speed.

Why Use Python with Docker?

• Reproducibility: Python applications, especially in data science or machine learning,


have specific dependencies that can vary across environments. Docker containers
ensure all dependencies are packaged together, leading to consistent results.
• Efficient Development and Deployment: Developers can build, test, and deploy Python
applications using Docker, allowing for seamless movement from development to
production.
• Isolation of Environments: Docker containers allow each Python application to run in
its own environment, minimizing dependency conflicts
Somaiya Vidyavihar University
K. J. Somaiya College of Engineering, Mumbai-77
Department of Computer Engineering

Implementation details:
Step 1: Download Docker Desktop

Go to the Docker Desktop for Windows download page and download the
installer.

Step 2: Run the Installer

Run the Docker Desktop installer and follow the installation instructions. Make sure to:

• Enable WSL 2 during installation for improved performance (for Windows 10/11).
• Restart your computer if prompted.
Somaiya Vidyavihar University
K. J. Somaiya College of Engineering, Mumbai-77
Department of Computer Engineering

Step 3: Start Docker Desktop

Launch Docker Desktop from the Start menu. Once started, Docker should run in the system
tray.
Somaiya Vidyavihar University
K. J. Somaiya College of Engineering, Mumbai-77
Department of Computer Engineering

Step 4: Creating container in docker


Somaiya Vidyavihar University
K. J. Somaiya College of Engineering, Mumbai-77
Department of Computer Engineering

Step 5: Sucessfully created container


Somaiya Vidyavihar University
K. J. Somaiya College of Engineering, Mumbai-77
Department of Computer Engineering
Somaiya Vidyavihar University
K. J. Somaiya College of Engineering, Mumbai-77
Department of Computer Engineering

Conclusion:-

Docker provides a powerful, consistent, and efficient solution for running applications in
isolated environments called containers. By setting up Docker on Linux or Windows, you can
build, test, and deploy applications with minimal setup across various systems. Containers
streamline the development and deployment process, offering significant advantages in
portability, scalability, and resource efficiency.

Following the installation and container creation steps allows you to:

• Run applications consistently across different environments,


• Efficiently manage dependencies,
• Simplify scaling and deployment processes.

Mastering Docker is a valuable skill, enabling faster, more reliable, and portable application
deployment across development, testing, and production environments.

You might also like