Improve markdown style in Docker documentation files
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# Using Docker for local development
|
# Using Docker for local development
|
||||||
|
|
||||||
You can use Docker to have a local CONSUL installation for development if:
|
You can use Docker to have a local CONSUL installation for development if:
|
||||||
|
|
||||||
- You're having troubles having [prerequisites](prerequisites.md) installed.
|
- 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 want to do a quick local installation just to try CONSUL or make a demo.
|
||||||
- You prefer not to interfer with other rails installations.
|
- 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
|
### Linux
|
||||||
|
|
||||||
1. Install Docker:
|
1. Install Docker:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
|
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
|
2. Install Docker Compose
|
||||||
|
|
||||||
```bash
|
```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 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
|
sudo chmod +x /usr/local/bin/docker-compose
|
||||||
@@ -44,24 +47,27 @@ sudo chmod +x /usr/local/bin/docker-compose
|
|||||||
|
|
||||||
### Windows
|
### 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:
|
If you encounter the "WSL 2 installation incomplete" error:
|
||||||
|
|
||||||
1) Start PowerShell as Administrator
|
1. Start PowerShell as Administrator
|
||||||
2) run `dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart`
|
1. Run `dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart`
|
||||||
3) run `dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart`
|
1. 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)
|
1. 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`
|
1. Run `wsl --set-default-version 2`
|
||||||
6) Restart your PC
|
1. 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. 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
|
## Installation
|
||||||
|
|
||||||
Clone the repo on your computer and enter the folder:
|
Clone the repo on your computer and enter the folder:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone git@github.com:consul/consul.git
|
git clone git@github.com:consul/consul.git
|
||||||
cd consul
|
cd consul
|
||||||
```
|
```
|
||||||
|
|
||||||
### macOS & Linux
|
### macOS & Linux
|
||||||
|
|
||||||
Then lets create our secrets and database config files based on examples:
|
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:
|
Then you'll have to build the container with:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker build -t consul .
|
docker build -t consul .
|
||||||
```
|
```
|
||||||
@@ -112,9 +119,11 @@ POSTGRES_PASSWORD=password docker-compose run app rails console
|
|||||||
```
|
```
|
||||||
|
|
||||||
To verify the containers are up execute:
|
To verify the containers are up execute:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker ps .
|
docker ps .
|
||||||
```
|
```
|
||||||
|
|
||||||
You should see output similar to this:
|
You should see output similar to this:
|
||||||

|

|
||||||
|
|
||||||
@@ -123,23 +132,29 @@ You should see output similar to this:
|
|||||||
Pending to be completed... Contributions Welcome!
|
Pending to be completed... Contributions Welcome!
|
||||||
|
|
||||||
## Having trouble?
|
## 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):
|
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:
|
1. Remove all CONSUL images:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose down --rmi all -v --remove-orphans
|
docker-compose down --rmi all -v --remove-orphans
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Remove all CONSUL containers
|
2. Remove all CONSUL containers
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose rm -f -s -v
|
docker-compose rm -f -s -v
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Verify if there is some container yet:
|
3. Verify if there is some container yet:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker ps -a
|
docker ps -a
|
||||||
```
|
```
|
||||||
|
|
||||||
Case positive, remove each one manually:
|
Case positive, remove each one manually:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker container rm <container_id>
|
docker container rm <container_id>
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# Usando Docker para desarrollo en local
|
# Usando Docker para desarrollo en local
|
||||||
|
|
||||||
Puedes usar Docker para tener una instalación local de CONSUL si:
|
Puedes usar Docker para tener una instalación local de CONSUL si:
|
||||||
|
|
||||||
- Estás teniendo problemas para instalar los [prerrequisitos](prerequisites.md) correctamente.
|
- 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.
|
- Quieres tener una instalación local rápidamente para probar o hacer una demo.
|
||||||
- Prefieres no interferir con instalaciones de apps Rails existentes.
|
- 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
|
### Linux
|
||||||
|
|
||||||
1. Instala Docker:
|
1. Instala Docker:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
|
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
|
2. Instala Docker Compose
|
||||||
|
|
||||||
```bash
|
```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 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
|
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!
|
Pendiente de ser completado... ¡Se agradecen las Contribuciones!
|
||||||
|
|
||||||
<h2 id="instalacion">Instalación</h2>
|
## Instalación
|
||||||
|
|
||||||
Clona el repositorio en tu ordenador y entra en el directorio:
|
Clona el repositorio en tu ordenador y entra en el directorio:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone git@github.com:consul/consul.git
|
git clone git@github.com:consul/consul.git
|
||||||
cd consul
|
cd consul
|
||||||
```
|
```
|
||||||
|
|
||||||
### macOS & Linux
|
### macOS & Linux
|
||||||
|
|
||||||
Creamos nuestros ficheros de secrets y database basados en los ejemplos:
|
Creamos nuestros ficheros de secrets y database basados en los ejemplos:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cp config/secrets.yml.example config/secrets.yml
|
cp config/secrets.yml.example config/secrets.yml
|
||||||
cp config/database-docker.yml.example config/database.yml
|
cp config/database-docker.yml.example config/database.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
Y generamos el contenedor:
|
Y generamos el contenedor:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker build -t consul .
|
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:
|
Para verificar que los contenedores estan corriendo usa:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker ps .
|
docker ps .
|
||||||
```
|
```
|
||||||
|
|
||||||
Deberías obtener algo similar a:
|
Deberías obtener algo similar a:
|
||||||

|

|
||||||
|
|
||||||
@@ -112,25 +121,30 @@ Deberías obtener algo similar a:
|
|||||||
|
|
||||||
Pendiente de ser completado... ¡Se agradecen las Contribuciones!
|
Pendiente de ser completado... ¡Se agradecen las Contribuciones!
|
||||||
|
|
||||||
|
|
||||||
## ¿Tienes problemas?
|
## ¿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:
|
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:
|
1. Quitar todas las imágenes de CONSUL:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose down --rmi all -v --remove-orphans
|
docker-compose down --rmi all -v --remove-orphans
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Quitar todos los contenedores de CONSUL
|
2. Quitar todos los contenedores de CONSUL
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose rm -f -s -v
|
docker-compose rm -f -s -v
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Verificar si todavía hay algún contenedor:
|
3. Verificar si todavía hay algún contenedor:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker ps -a
|
docker ps -a
|
||||||
```
|
```
|
||||||
|
|
||||||
Caso positivo, eliminar cada uno de forma manual:
|
Caso positivo, eliminar cada uno de forma manual:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker container rm <container_id>
|
docker container rm <container_id>
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user