The dockerized version of the project facilitates the process of installing the system on your local machine.
- Docker, Docker-Compose
The following installation instructions are taken from the websites below. Check them out for more details.
- https://docs.docker.com/install/linux/docker-ce/ubuntu/
- https://docs.docker.com/install/linux/linux-postinstall/
- https://docs.docker.com/compose/install/
- Update the
aptpackage index:
sudo apt update- Install packages to allow
aptto use a repository over HTTPS:
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common- Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint:
sudo apt-key fingerprint 0EBFCD88The output should look as follows:
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) <docker@docker.com>
sub rsa4096 2017-02-22 [S]- Use the following command to set up the stable repository:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"- Update the
aptpackage index:
sudo apt update- Install the latest version of Docker Engine - Community:
sudo apt-get install docker-ce docker-ce-cli containerd.io- Verify that Docker Engine - Community is installed correctly by running the hello-world image:
sudo docker run hello-worldThis command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.
Docker Engine - Community is installed and running. The docker group is created but no users are added to it. You need to use sudo to run docker commands. Fulfilling the following steps will let you run docker commands without sudo.
- Create the docker group:
sudo groupadd docker- Add your user to the docker group:
sudo usermod -aG docker $USER- Run the following command to activate the changes to groups:
newgrp docker- Verify that you can run docker commands without
sudo:
docker run hello-world- Run this command to download the current stable release of Docker Compose:
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose- Check if your ip address matches the address in the docker-compose.yml file. Type the following command and look for "docker0":
ip addr showIf your ip address is different, change it in the docker-compose.yml file.
First, you need to build docker containers:
docker-compose up --build --no-cacheNote: You may want to start the system in detached mode by adding -d to the docker-compose command, the console output can then be accessed using docker-compose logs -f service_name.
When you make changes to the project (e.g. to some CiViL bots), you will need to rebuild the containers.
To take the system down and remove the virtual network run:
docker-compose downTo remove all unused images:
docker image prune -aTo remove all building cache:
docker builder prune -aIf you just wish to re-build the images that have been changed and restart the necessary containers without downtime run:
docker-compose up --build --no-cache
Only containers with changes will be rebuilt, the others will be skipped.
Use the following command if you wish to view system logs:
docker-compose logs -fUse the following command if you wish to view the output of a particular system service such as the directions_bot:
docker-compose logs -f directions_botTo exit the preview, press Ctrl+C. You can also use docker attach directions_bot to view the logs, but this directly attaches the terminal so when you press Ctrl+C, it'll stop the service.
##AWS Instance
To access to the aws instance
ssh -i /path/key-pair-name.pem instance-user-name@instance-public-dns-name