¿cuanta gente a visto el blog?

comandos de Docker By Chat GPT

ip a



 sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

sudo dnf install docker-ce --nobest -y



docker -v

docker -h

sudo systemctl start docker
sudo systemctl enable docker
sudo systemctl status docker
control c

sudo docker search ubuntu

sudo docker pull ubuntu


sudo docker images

sudo docker run ubuntu echo "Hola Mundo"

sudo docker ps

sudo docker ps -a
Ver todos los contenedores, incluso los detenidos:

sudo docker start 057162edea78
sudo docker start [ID_DEL_CONTENEDOR]


sudo docker run -it ubuntu /bin/bash

sudo docker run -it --name instalado_git ubuntu /bin/bash
apt-get update

apt-get install git
y


dpkg -l | grep git

sudo docker commit -m "INSTALADO GIT" -a "Author_Name" [ID_CONTENEDOR] GIT/ubuntu:v1

sudo docker commit -m "INSTALADO GIT" -a "Ivan_Diaz" 057162edea78 GIT/ubuntu:v1


sudo docker run -d -p 8000:80 --name server2 apache/ubuntu:v1 /usr/sbin/apache2ctl -D FOREGROUND
sudo docker run -it --name server4 -v /home/jonathan/volumen01:/volumen01 apache/ubuntu:v1 /bin/bash
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
mkdir compose
cd compose
sudo touch docker-compose.yml

Ejemplo de un archivo docker-compose.yml para WordPress y MariaDB

version: '3.8'

services:
  wordpress:
    image: wordpress:latest
    ports:
      - "8000:80"
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: exampleuser
      WORDPRESS_DB_PASSWORD: examplepass
      WORDPRESS_DB_NAME: exampledb
    volumes:
      - wordpress_data:/var/www/html

  db:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: examplepass
      MYSQL_DATABASE: exampledb
      MYSQL_USER: exampleuser
      MYSQL_PASSWORD: examplepass
    volumes:
      - db_data:/var/lib/mysql

volumes:
  wordpress_data:
  db_data:



sudo docker-compose up -d

No hay comentarios.:

Publicar un comentario