Run Containers in RHEL - RHCSA (RH134).pdf

support8872 661 views 27 slides Sep 21, 2024
Slide 1
Slide 1 of 27
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27

About This Presentation

Slides on how to run containers - Part of RHCSA (RH134) syllabus


Slide Content

Run Containers

Container
●From shipping containers, the concept of 'container' began.
●Travel globally with consistent measurements.
●Global infrastructure easily handles these standardized containers.
●Resulting in universal ease of transportation and storage.

Lightweight, portable units of software that package code and dependencies
together

What are containers?

Container Softwares
Released on: March 20th 2013
Released on: August 2018
Developed by : Solomon Hykes
Developed by :

Docker vs Podman
Docker Podman
Support in RHEL 8 Not Supported by RHEL 8 An alternative to Docker in RHEL 8
Service
Management
Controlled through native Linux service
management tools
Utilizes native Linux service management tools
Daemon Uses a daemon (background process) Runs as a user process (no daemon)
Rootless Requires root privileges Supports rootless mode
Security Relies on containerd and runc Uses its own libraries for container management
Compatibility
Works well across various operating
systems
Primarily designed for Linux systems
Image formats Uses Docker image format
Supports multiple image formats including
Docker

● Podman: Manages pods and containers (run, stop, start, etc.)

● Buildah: Builds, pushes, and signs container images

● Skopeo: Copies, inspects, deletes, and signs images

● runc: Provides run and build features for Podman and Buildah

● crun: Optional runtime offering flexibility and security for rootless
containers.

Red Hat CLI tools

Podman Container Terms
●Images: Templates used to create
containers, which can be converted back to
images

●Pods: Groups of containers deployed
together on a host, symbolized by the three
seals in the Podman logo

Podman commands
Install podman on rhel
●Command : dnf install podman -y
Check podman version
●Command : podman version

To get info about all commands in podman
●Command : podman help

Get detailed information about the Podman env., including the system
conf, runtime information, and other relevant details
●Command : podman info

On scrolling down in podman info you’ll get what all registry it is using

Configuration file specifying container image registries for Podman
●Command : cat /etc/containers/registries.conf

Search image in registries
●Command : podman search httpd

Display Logs Of Recently Created Containers
●Command : podman logs -l

Download the amd64 Version of the httpd Image from Docker Hub
●Command : podman pull docker.io/amd/httpd

Download the Default httpd Image from Docker Hub
●Command: podman pull httpd

List All Available Images on Your Local System
●Command: podman images
Removes The Specified Image
●Command : podman rmi docker.io/amd64/httpd

Run an httpd Container and Expose it on Port 8080
●Command:podman run -d -p 8080:80/tcp --name http_container httpd
Run an Interactive httpd Container and Expose it on Port 8081
●Command: podman run -it -p 8081:80/tcp --name 2_http_container httpd

List All Running Containers
●Command: podman ps
List All Containers (Running and Stopped)
●Command:podman ps -a

Stop a running container
●Command: podman stop http_container

Start a Stopped Container
●Command: podman start http_container

Remove a Container
●Command: podman rm http_container

View Logs of a Container
●Command: podman logs http_container

Access a Running Container's Shell
●Command: podman exec -it http_container /bin/bash

Inspect a Container's Details
●Command: podman inspect http_container