ip a
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install docker-ce --nobest -y
sudo docker start 057162edea78
sudo docker run -it --name instalado_git ubuntu /bin/bash
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 MariaDBversion: '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