Practica 1: Instalacion y configuracion de Docker (1Pts)

  Рет қаралды 21

Angel Gabriel Gil Rojas

Angel Gabriel Gil Rojas

Күн бұрын

Пікірлер: 1
@angelgil2924
@angelgil2924 14 күн бұрын
#********************************************************************************* #* * #* ██╗ █████╗ ██████╗ ██████╗ █████╗ ██████╗ ███████╗ * #* ██║ ██╔══██╗██╔══██╗██╔════╝ ██╔══██╗██╔══██╗██╔════╝ * #* ██║ ███████║██████╔╝██║ ███╗███████║██║ ██║█████╗ * #* ██║ ██╔══██║██╔══██╗██║ ██║██╔══██║██║ ██║██╔══╝ * #* ███████╗██║ ██║██████╔╝╚██████╔╝██║ ██║██████╔╝███████╗ * #* ╚══════╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚══════╝ * #* * #* Laboratorio Modulo VIII - 4 Puntos * #* By: The_White_Hat_? 🕶 * #* * #********************************************************************************* # Variables globales DOCKER_COMPOSE_YML="docker-compose.yml" PORTAINER_URL="localhost:9000" WORDPRESS_URL="localhost:8080" SEPARATOR="*************************************************************************" # Encabezado estético tipo hacker header() { printf " \033[1;32m%s " "$SEPARATOR" printf "* 🌐 Laboratorio Modulo VIII - Prácticas con Docker (4 Pts) * " printf "* Ciber Seguridad by The_White_Hat_? 🕶 * " printf "%s\033[0m " "$SEPARATOR" } # Verificación de instalación de Docker check_docker_installed() { if ! command -v docker &>/dev/null; then printf "\033[1;31m[!] Docker no encontrado, iniciando instalación...\033[0m " sudo dnf -y update --nobest --skip-broken sudo dnf config-manager --add-repo=download.docker.com/linux/centos/docker-ce.repo sudo dnf remove -y podman buildah runc sudo dnf install -y docker-ce --nobest sudo systemctl start docker sudo systemctl enable docker else printf "\033[1;32m[✔] Docker ya está instalado.\033[0m " fi } # Práctica 1: Instalación de Nginx run_practice1() { if ! docker ps | grep -q mi_web; then printf "\033[1;33m[~] Configurando contenedor de Nginx...\033[0m " docker pull nginx mkdir -p /home/website sudo docker run -d --name mi_web -p 8888:80 -v /home/website:/usr/share/nginx/html/ nginx echo "Bienvenido a Nginx - Hacker LabCon Nginx en Docker" | sudo tee /home/website/index.html >/dev/null printf "\033[1;32m[✔] Contenedor creado con éxito. Acceda a: localhost:8888\033[0m " else printf "\033[1;36m[+] El contenedor Nginx ya está en ejecución.\033[0m " fi } # Práctica 2: Instalación de Portainer run_practice2() { if ! docker ps | grep -q portainer; then printf "\033[1;33m[~] Configurando Portainer...\033[0m " docker pull portainer/portainer-ce docker volume create portainer_data docker run -d -p 9000:9000 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:2.21.4 printf "\033[1;32m[✔] Portainer configurado. Acceda en: %s\033[0m " "$PORTAINER_URL" else printf "\033[1;36m[+] Portainer ya está en ejecución.\033[0m " fi } # Práctica 3: Despliegue de Wordpress con Docker Compose run_practice3() { printf "\033[1;33m[~] Configurando Docker Compose y Wordpress...\033[0m " sudo curl -sL "github.com/docker/compose/releases/download/$(curl -s api.github.com/repos/docker/compose/releases/latest | grep -Po '"tag_name": "\K.*?(?=")')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose printf "\033[1;36m[*] Docker Compose instalado.\033[0m " printf "\033[1;33m[~] Configurando archivo docker-compose.yml...\033[0m " cat
Practica 2: Instalacion de Portainer (1Pts)
14:25
Angel Gabriel Gil Rojas
Рет қаралды 13
Practica 1 Instalacion y configuracion de Docker
16:04
Jean Francisco Bello Santos
Рет қаралды 51
The Ultimate Sausage Prank! Watch Their Reactions 😂🌭 #Unexpected
00:17
La La Life Shorts
Рет қаралды 9 МЛН
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 23 МЛН
Why I Chose Copywriting as a Beginner
9:08
Harleen Saini
Рет қаралды 386
Practica 1: compartir archivos entre linux utilizando NFS (1pts)
13:49
Angel Gabriel Gil Rojas
Рет қаралды 16
El BCE garantiza el fracaso del euro digital. José Luis Cava
2:30
Jose Luis Cava
Рет қаралды 15 М.
Beach Bunny - Prom Queen (Official Music Video)
3:08
Beach Bunny
Рет қаралды 40 МЛН
Practica 3: Comandos Ad-Hoc (1Pts)
8:49
Angel Gabriel Gil Rojas
Рет қаралды 31
Otabek MuhammadZohid - Sendaqasi yo'q (Official Music Video)
5:40
Otabek Muhammadzohid
Рет қаралды 18 МЛН