CONSUL
Search…
Docker
You can use Docker to have a local CONSUL installation for development if:
    You're having troubles having prerequisites 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.

Prerequisites

You should have installed Docker and Docker Compose in your machine:

macOS

You can follow the official docker install
Or if you have homebrew and cask installed you can just:
1
brew install docker
2
brew install docker-compose
3
brew cask install docker
4
open -a docker
Copied!
You'll be asked to give Docker app permissions and type your password, then you're set.

Linux

    1.
    Install Docker:
    1
    sudo apt-get update
    2
    sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
    3
    sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
    4
    sudo apt-get update
    5
    apt-cache policy docker-engine
    6
    sudo apt-get install -y docker-engine
    Copied!
    2.
    Install Docker Compose
    1
    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)"
    2
    sudo chmod +x /usr/local/bin/docker-compose
    Copied!

Windows

https://www.docker.com/get-started --> Under Docker Desktop, select Download for Windows with default options checked, and run. Should take ~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 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

Installation

Clone the repo on your computer and enter the folder:
1
git clone [email protected]:consul/consul.git
2
cd consul
Copied!

macOS & Linux

Then lets create our secrets and database config files based on examples:
1
cp config/secrets.yml.example config/secrets.yml
2
cp config/database-docker.yml.example config/database.yml
Copied!
Then you'll have to build the container with:
1
docker build -t consul .
Copied!
Create your app database images:
1
POSTGRES_PASSWORD=password docker-compose up -d database
Copied!
Once built you can initialize your development DB and populate it with:
1
POSTGRES_PASSWORD=password docker-compose run app rake db:create db:migrate
2
POSTGRES_PASSWORD=password docker-compose run app rake db:dev_seed
Copied!

Windows

Pending to be completed... Contributions Welcome!

Running local CONSUL with Docker

macOS & Linux

Now we can finally run the application with:
1
POSTGRES_PASSWORD=password docker-compose up
Copied!
And you'll be able to access it at your browser visiting http://localhost:3000
Additionally, if you want to run the rails console just run in another terminal:
1
POSTGRES_PASSWORD=password docker-compose run app rails console
Copied!
To verify the containers are up execute:
1
docker ps .
Copied!
You should see output similar to this:

Windows

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:
    1.
    Remove all CONSUL images:
    1
    docker-compose down --rmi all -v --remove-orphans
    Copied!
    2.
    Remove all CONSUL containers
    1
    docker-compose rm -f -s -v
    Copied!
    3.
    Verify if there is some container yet:
    1
    docker ps -a
    Copied!
    Case positive, remove each one manually:
    1
    docker container rm <container_id>
    Copied!
Last modified 1mo ago