0% found this document useful (0 votes)
19 views31 pages

Devops Tools

The document provides an overview of DevOps and Agile methodologies, highlighting their focus on collaboration, iterative development, and fast delivery of software. It also covers Linux operating system basics, including file structure and essential commands, as well as Docker and container management, detailing the creation and management of containers and images. Key commands and best practices for using Docker are included to facilitate effective containerization.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views31 pages

Devops Tools

The document provides an overview of DevOps and Agile methodologies, highlighting their focus on collaboration, iterative development, and fast delivery of software. It also covers Linux operating system basics, including file structure and essential commands, as well as Docker and container management, detailing the creation and management of containers and images. Key commands and best practices for using Docker are included to facilitate effective containerization.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

1 iTeam univ

DEVOPS Tools

Dr. Mohamed BEN ALI


AI Solutions
iTeam research Director

Confidential Copyright ©
2

Devops ?

Confidential Copyright ©
3

Devops ?
What is Agile ?
●Software development methodology.
●Centered round the idea of iterative and incremental development

Requirements and solutions evolve through collaboration between


self-organizing and small teams.
Enables teams to deliver value faster, with greater quality and
predictability, and greater aptitude to respond to change.
●Feedback given by customer.
●Scrum is the most widely used Agile method.
●Others agile methods :
– Kanban
– Extreme Programming (XP)
– Feature-Driven Development (FDD)
– RAP Copyright ©
Confidential
4

Devops ?
What is DevOps

Software development methodology and culture.


A practice of bringing development and operations teams
together.
– Relatively larger team size as it involves all the stakeholders.
– Focus on collaboration between all teams

Central concept is to manage end-to-end engineering


processes.
End-to-end business solution and fast delivery.
– Deliver code to production DAILY or every few hours.
●Feedback comes from the internal team.
●Supports Agile
Confidential Copyright ©
5

Devops ?
What is DevOps

Software development methodology and culture.


A practice of bringing development and operations teams
together.
– Relatively larger team size as it involves all the stakeholders.
– Focus on collaboration between all teams

Central concept is to manage end-to-end engineering


processes.
End-to-end business solution and fast delivery.
– Deliver code to production DAILY or every few hours.
●Feedback comes from the internal team.
●Supports Agile
Confidential Copyright ©
6

Devops
DevOps is a combination of certain culture strategies, dedicated
practices and tools that help companies accelerate the process
of creating applications and services.

With DevOps, the process of product development and


optimization goes faster compared with the traditional model of
software development.

Confidential Copyright ©
7

Linux

Confidential Copyright ©
8

Linux
A Linux operating system, often simply called "Linux," is a Unix-like
operating system. It is software that acts as an interface between the user
and computer hardware. Linux is known for its stability, security, and
flexibility, and it is widely used worldwide, both on servers and desktops.

Confidential Copyright ©
9

Linux

Confidential Copyright ©
10

Linux
● /bin: This folder contains essential binary files necessary for system
boot. It includes basic commands required for system recovery in case
of a problem.
● /boot: The "boot" folder contains files necessary for the system boot
process, such as the Linux kernel and bootloader configuration files
(like GRUB).
● /etc: The "etc" folder contains most of the system configuration files. It
includes subfolders for system configurations, startup scripts, network
files, log files, and more.

Confidential Copyright ©
11

Linux
● /home: The "home" folder contains users' personal directories. Each
user has their own subdirectory in "/home" where they can store
personal files.
● /lib and /lib64: These folders contain shared libraries (shared code files)
required by system programs and third-party applications.
● /media: The "media" folder is used to temporarily mount removable
storage devices, such as USB drives or CDs/DVDs.

Confidential Copyright ©
12

Linux
● /root: The "root" folder is the home directory of the superuser (root).
● /srv: The "srv" folder is intended to store service-specific data for the system, often used by
servers.
● /tmp: The "tmp" folder is used for temporary file storage by applications and users. Files
may be automatically deleted after a certain period.
● /usr: This folder contains the majority of system programs and files, including binaries,
libraries, headers, and documentation.
● /var: The "var" folder contains system variable data, such as system logs, database files,
and temporary files.

Confidential Copyright ©
13

Linux
● ls: Lists files and directories in the current directory. For example, ls -l displays a
detailed list.
● cd: Changes the current directory. For example, cd /folder moves to the specified folder.
● pwd: Displays the full path of the current directory.
● mkdir: Creates a new directory. For example, mkdir my_folder creates a directory named
"my_folder."
● touch: Creates a new empty file or updates the modification date of an existing file. For
example, touch my_file.txt creates an empty file named "my_file.txt."

Confidential Copyright ©
14

Linux
● rm: Deletes files or directories. For example, rm file.txt deletes the file "file.txt." Use with
caution, as this action can be irreversible.
● cp: Copies files and directories. For example, cp file.txt folder/ copies "file.txt" into the
specified folder.
● mv: Moves or renames files and directories. For example, mv file.txt new_name.txt
renames the file.
● cat: Displays the contents of a file. For example, cat my_file.txt shows the file's content.
● more or less: Allows you to scroll through a file's content page by page.
● grep: Searches for patterns in text. For example, grep pattern file.txt searches for the
pattern in the file.
● head and tail: Display the first or last lines of a file, respectively.

Confidential Copyright ©
15

Linux
● chmod: Modifies file and directory permissions. For example, chmod +x script.sh grants
execution permission to the script.
● chown: Changes the owner of a file or directory. For example, chown user:group file.txt
changes the file's owner and group.
● ps: Displays a list of running processes.
● kill: Sends a signal to a process to terminate it. For example, kill -9 PID forcefully stops the
process with the specified PID.
● df: Displays disk space usage.
● du: Shows disk space usage of a directory.
● tar: Archives or extracts files and directories.
● ssh: Connects to a remote computer using the SSH protocol.
● wget or curl: Downloads files from the Internet via the command line.

Confidential Copyright ©
16

Linux
—> Ubuntu (sys administration): https://pastebin.com/raw/DWPRAn98

—> RedHat (sys administration): https://pastebin.com/raw/kCbZSnFC

——>

Confidential Copyright ©
17

Docker and containers

● Provides the isolation among containers


● Helps them share the OS
● Docker = Dock worker ⇒ issues of system
Manage containers
● Developed initially by Docker.com
● Downloadable for Linux, Windows, and Mac
from Docker.com

Confidential Copyright ©
18

Docker Engine
Components

Confidential Copyright ©
19

Image Registries

Containers are built from images and can be saves as images


● Images are stored in registries
– Local registry on the same host
– Docker Hub Registry: Globally shared
– Private registry on Docker.com
● Any component not found in the local registry is downloaded from specified
location.
●Official Docker Registry: Images vetted by Docker
●Unofficial Registry: Images not vetted (Use with care)
●Each image has several tags, e.g., v2, latest, ...
●Each image is identified by its 256-bit hash

Confidential Copyright ©
20

Building Container
Images
● Create a Dockerfile that describes the application, its dependencies, and how to run
it.
● WORKDIR, EXPOSE, ENTRYPOINT result in tags. Others in Layers.

Confidential Copyright ©
21

Available commands

Confidential Copyright ©
22

Examples docker

● Create and start a container :


docker create -t -i alpine sh
docker start -a -i 067f4b9e2eda
● List the most recently created images
docker images
● Show both running containers
docker ps
● Show both running and stopped containers
docker ps -a

Confidential Copyright ©
23

Commands docker

● provides detailed information on container :


docker inspect 067f4b9e2eda
● Get an instance’s network settings :
docker inspect --format='{{.NetworkSettings}}'\ 067f4b9e2eda
● Get an instance’s IP address
docker inspect --\
format='{{range .NetworkSettings.Networks}}\{{.IPAddress}}
{{end}}' 067f4b9e2eda
● Get an instance’s MAC address :
docker inspect --format='{{range .NetworkSettings.Networks}}\
{{.MacAddress}}{{end}}' 067f4b9e2eda

Confidential Copyright ©
24

Commands docker

● Run an image with assigning container name, pseudo-TTY and latest version of
image:
docker run --name alpine1 -it alpine:latest
● Run an image in background (daemon):
docker run -d nginx:latest
● Execute a command on the container :
docker exec -t alpine1 cat /etc/os-release
● Interact with container (shell)
docker exec -it alpine1 sh

Confidential Copyright ©
25

Commands docker

● Stop a container :
docker stop alpine1
● Remove one or more stopped container :
docker rm alpine1
● Remove all stopped containers :
docker container prune
● Remove unused images
docker image prune
● Send the default KILL signal to the container
docker kill 067f4b9e2eda

Confidential Copyright ©
26

Commands docker
● provide better isolation and interoperability between containerized applications

– automatically expose all ports to each other

– no ports exposed to the outside world

● provide automatic DNS resolution between containers. Containers can be attached and detached from
user-defined networks on the fly.

-> Commands :

– docker network create my-net

– docker network rm my-net

– docker create --name my-nginx --network my-net --publish 8080:80 \

nginx:latest

– docker network connect my-net my-nginx

– docker network disconnect my-net my-nginx


Confidential Copyright ©
27

Commands docker
Volumes created and managed by Docker.

● Some use cases for volumes include:

– Sharing data among multiple running containers.

– Store your container’s data on a remote host or a cloud provider, rather than

locally.

– Back up, restore, or migrate data from one Docker host to another.

● Commands :

– docker volume create my-vol

– docker volume ls

– docker volume inspect my-vol

– docker volume rm my-vol

– docker run -v /dbdata --name dbstore2 ubuntu /bin/bash


Confidential Copyright ©

– docker run -d --name devtest --mount source=myvol2,target=/app nginx:latest


28

Dockerfile
● Docker can build images automatically by reading the instructions from a Dockerfile.
● A Dockerfile is a text document that contains all the commands a user could call on
the command line to assemble an image.
● Docker can build images automatically by reading the instructions from a Dockerfile.

→ docker build path .

Confidential Copyright ©
29

FROM, RUN instructions


● A Dockerfile must start with a `FROM` instruction
● FROM instruction specifies the Base Image from which you are building.
● The RUN instruction will execute any commands in a new layer on top of the current
image and commit the results.
● RUN has 2 forms:

– RUN <command> (shell form, the command is run in a shell, which by default is
/bin/sh -c on Linux or cmd /S /C on Windows)

– RUN ["executable", "param1", "param2"] (exec form)

Confidential Copyright ©
30

Dockerfile exp
FROM ubuntu

# Install vnc, xvfb in order to create a 'fake' display and firefox

RUN apt-get update && apt-get install -y x11vnc xvfb firefox

RUN mkdir ~/.vnc

# Setup a password

RUN x11vnc -storepasswd 1234 ~/.vnc/passwd

# Autostart firefox (might not be the best way, but it does the trick)

RUN bash -c 'echo "firefox" >> /.bashrc'

EXPOSE 5900

CMD ["x11vnc", "-forever", "-usepw", "-create"]


Confidential Copyright ©
31

Best docker command


● docker run -it -- name <container-name> -v
/path/to/data_local:/path/to/data_container <image-name>
● docker stop <container_name> or <container_id>
● docker start <container_name> or <container_id>
● docker rm <container_name> or <container_id>
● docker exec -it <container_name> or <container_id> bash
● docker stats
● docker ps -a <container_name> or <container_id>
● docker ps <container_name> or <container_id>

Confidential Copyright ©

You might also like