From 63f23852f5a301851363ab58d00d6408771a6d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 5 Sep 2021 01:22:55 +0200 Subject: [PATCH] Improve markdown style in Docker documentation files --- docs/en/installation/docker.md | 31 +++++++++++++++++++++++-------- docs/es/installation/docker.md | 18 ++++++++++++++++-- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/docs/en/installation/docker.md b/docs/en/installation/docker.md index 47df4cdae..9bfae5c1b 100644 --- a/docs/en/installation/docker.md +++ b/docs/en/installation/docker.md @@ -1,6 +1,7 @@ # Using Docker for local development You can use Docker to have a local CONSUL installation for development if: + - You're having troubles having [prerequisites](prerequisites.md) installed. - You want to do a quick local installation just to try CONSUL or make a demo. - You prefer not to interfer with other rails installations. @@ -27,6 +28,7 @@ You'll be asked to give Docker app permissions and type your password, then you' ### Linux 1. Install Docker: + ```bash sudo apt-get update sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D @@ -37,6 +39,7 @@ sudo apt-get install -y docker-engine ``` 2. Install Docker Compose + ```bash sudo curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/1.15.0/docker-compose-$(uname -s)-$(uname -m)" sudo chmod +x /usr/local/bin/docker-compose @@ -44,24 +47,27 @@ sudo chmod +x /usr/local/bin/docker-compose ### Windows -https://www.docker.com/get-started --> Under Docker Desktop, select Download for Windows with default options checked, and run. Should take ~5 minutes. +Go to the [https://www.docker.com/get-started](Get Started with Docker) page. Under Docker Desktop, select Download for Windows with default options checked, and run. Should take about 5 minutes. If you encounter the "WSL 2 installation incomplete" error: -1) Start PowerShell as Administrator -2) run `dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart` -3) run `dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart` -4) install [WSL2 Linux kernel update package for x64 machines](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi) -5) run `wsl --set-default-version 2` -6) Restart your PC -7) The Docker Enginer will start up. Give it a few minutes. You now have the option of using the docker desktop app (GUI) and `docker` PowerShell/Bash commands +1. Start PowerShell as Administrator +1. Run `dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart` +1. Run `dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart` +1. Install [WSL2 Linux kernel update package for x64 machines](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi) +1. Run `wsl --set-default-version 2` +1. Restart your PC +1. The Docker Enginer will start up. Give it a few minutes. You now have the option of using the docker desktop app (GUI) and `docker` PowerShell/Bash commands + ## Installation Clone the repo on your computer and enter the folder: + ```bash git clone git@github.com:consul/consul.git cd consul ``` + ### macOS & Linux Then lets create our secrets and database config files based on examples: @@ -72,6 +78,7 @@ cp config/database-docker.yml.example config/database.yml ``` Then you'll have to build the container with: + ```bash docker build -t consul . ``` @@ -112,9 +119,11 @@ POSTGRES_PASSWORD=password docker-compose run app rails console ``` To verify the containers are up execute: + ```bash docker ps . ``` + You should see output similar to this: ![docker ps](https://i.imgur.com/ASvzXrd.png) @@ -123,23 +132,29 @@ You should see output similar to this: Pending to be completed... Contributions Welcome! ## Having trouble? + Run these commands at **Consul's directory**, to erase all your previous Consul's Docker images and containers. Then restart the Docker [installation process](#installation): 1. Remove all CONSUL images: + ```bash docker-compose down --rmi all -v --remove-orphans ``` 2. Remove all CONSUL containers + ```bash docker-compose rm -f -s -v ``` 3. Verify if there is some container yet: + ```bash docker ps -a ``` + Case positive, remove each one manually: + ```bash docker container rm ``` diff --git a/docs/es/installation/docker.md b/docs/es/installation/docker.md index 1cbc04b28..5340e6acc 100644 --- a/docs/es/installation/docker.md +++ b/docs/es/installation/docker.md @@ -1,6 +1,7 @@ # Usando Docker para desarrollo en local Puedes usar Docker para tener una instalación local de CONSUL si: + - Estás teniendo problemas para instalar los [prerrequisitos](prerequisites.md) correctamente. - Quieres tener una instalación local rápidamente para probar o hacer una demo. - Prefieres no interferir con instalaciones de apps Rails existentes. @@ -27,6 +28,7 @@ La aplicación de Docker te pedirá darle permisos e intrudocir tu contraseña. ### Linux 1. Instala Docker: + ```bash sudo apt-get update sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D @@ -37,6 +39,7 @@ sudo apt-get install -y docker-engine ``` 2. Instala Docker Compose + ```bash sudo curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/1.15.0/docker-compose-$(uname -s)-$(uname -m)" sudo chmod +x /usr/local/bin/docker-compose @@ -46,22 +49,26 @@ sudo chmod +x /usr/local/bin/docker-compose Pendiente de ser completado... ¡Se agradecen las Contribuciones! -

Instalación

+## Instalación Clona el repositorio en tu ordenador y entra en el directorio: + ```bash git clone git@github.com:consul/consul.git cd consul ``` ### macOS & Linux + Creamos nuestros ficheros de secrets y database basados en los ejemplos: + ```bash cp config/secrets.yml.example config/secrets.yml cp config/database-docker.yml.example config/database.yml ``` Y generamos el contenedor: + ```bash docker build -t consul . ``` @@ -102,9 +109,11 @@ POSTGRES_PASSWORD=password docker-compose run app rails console ``` Para verificar que los contenedores estan corriendo usa: + ```bash docker ps . ``` + Deberías obtener algo similar a: ![docker ps](https://i.imgur.com/ASvzXrd.png) @@ -112,25 +121,30 @@ Deberías obtener algo similar a: Pendiente de ser completado... ¡Se agradecen las Contribuciones! - ## ¿Tienes problemas? + Ejecute los comandos en el **directorio de CONSUL**, para borrar todas las imágenes y contenedores anteriores del Docker de CONSUL. Luego, reinicie el [proceso de instalación](#instalacion) de Docker: 1. Quitar todas las imágenes de CONSUL: + ```bash docker-compose down --rmi all -v --remove-orphans ``` 2. Quitar todos los contenedores de CONSUL + ```bash docker-compose rm -f -s -v ``` 3. Verificar si todavía hay algún contenedor: + ```bash docker ps -a ``` + Caso positivo, eliminar cada uno de forma manual: + ```bash docker container rm ```