Docker is a software container platform, which bundles only the libraries and settings, required to make a software run isolated on a shared operating system.
Running Jethro Manager using Docker, guarantees that it will always run in the same manner, regardless of where it is deployed.
This article will explain in detail, step by step, how to configure a Jethro Manager Docker container on a Linux machine:
Setup Jethro Manger Docker
1. Install and start Docker
2. Download and Load the Image
In order to run a docker container, you should first have the image loaded into your local docker repository.
- Sign in as user root (or a sudoer)
Download the image as .tar:
Run 'docker load' with the full name of the tar file downloaded. For example:
3. Prepare folders to mount with the docker image file system
Since a docker container is a stateless independent file system, separated from the host's file system, it is recommended to create folders on the host's file system, and to mount them to the container's file system.
That way it would keep the information collected by Jethro persistent, even if the container will be lost.
The following code block will suggest a set of folder names to be used for the needs of Jethro's persistancy, but you can also use other paths if you prefer so.
4. Plan the preffered configurations for running the image
Docker allows multiple parameters of configuration (called 'OPTIONS'), to be set when running the image. In addition, each specific docker image can offer/require it's own environment variables.
For Jethro Manager Docker image, the following parameters needs to be defined, when the image will start to run:
- Container Name - Decide on a name for the image container. Specifying a name gives the ability to use it when referencing the container within a Docker network, instead of using a long generated ID.
Recommended name: 'jethroManagerDocker'.
- Ports Mapping - Jethro exposes its services to external connections through ports. The ports which are exposed within the Jethro Docker image, needs to be mapped to ports that can be exposed on the host.
- Normally, Jethro uses the following ports:
- 9100 - For Jethro Manager.
- 9111-9200 - For the query engines of each instance.
- SSH connections normally uses the port 22 (Not related to Jethro specifically, this is a port commonly used on most Linux environments for establishing a secured log in to the machine).
- Since the SSH port used by the Host, is the same port used by the Docker image (22), it is recommended to map the Docker image SSH port, to a port address which is not in conflict with the Host one's (for example 9322).
- Normally, Jethro uses the following ports:
5. Collect the image information
To run the Docker container, we will need to collect two parameters:
- 'IMAGE REPOSITORY'
Those can be found by running the following command:
The result should look like:
6. Create and start a Container
Now that we have prepared the folders for mounting, the ports mapping, the values for the volumes mount, and the image information, we are ready to hit the 'run' command. The basic 'docker run' command takes this form:
On this document, only the parameters required for a Jethro Manager docker will be described. A full documentation of the command, can be found here.
|Run the container in the background in a “detached” mode|
Give extended privileges to this container
By default a container is not allowed to access any device. A “privileged” container is given access to all devices on the host (as well as set some configuration in AppArmor or SELinux) to allow the container nearly all the same access to the host as processes running outside containers on the host.
|Specifying a name gives the ability to use it when referencing the container within a Docker network|
Publish a container᾿s port or a range of ports to the host.
Format: hostPort:containerPort . Both hostPort and containerPort can be specified as a range of ports.
When specifying ranges, the number of container ports in the range must match the number of host ports in the range.
Bind mount a volume
7. Browse to Jethro Manager
1) To open Jethro Manger from a browser, point it to http://<IP>:<PORT>.
The IP is the host's IP, and the PORT is usually the default port for Jethro Manager - 9100.
However, if the mapping of the container's 9100 port in the host machine is different, use the mapped port instead.
2) Once Jethro Manager UI opens in the browser, you will be navigated to the server screen to establish an SSH connection.
To do so, enter the IP of the host machine, and provide its SSH key for user 'jethro' (located in the Jethro server machine under /home/jethro/.JethroKeys/id_rsa).
Connnecting to Jethro containers
If you need to connnect to the container, or to interact with it, there are two methods available:
1) SSH - use the IP of the machine, port 9322 (unless if you decided to change it), and the credentials: user jethro, password jethro.
2) Bash - You can use the local machine to connect to the Docker machine, and run shell or bash commands on it. To do so:
- Run 'docker ps' and get the container-name, or container-id
Run 'docker exec -it <container-name-or-id> bash' or 'docker exec -it jethroManagerDocker sh'
docker stop <CONTAINER> - Stop a Container
docker start <CONTAINER> - Start a Container
docker rm <CONTAINER> - Remove a Container
docker rmi <IMAGE> - Remove an Image
To collect information about the list of images loaded on the host, Run:
It will show all top level images, their repository and tags, when they were created, and their size.
The tag column will include the Jethro Manager version.
To collect information about the list of containers running on the host, Run:
It will show only running containers by default. To see all containers: docker ps -a
If you can't connect to the server or to any of the instances, make sure that:
1) The mapped ports of these instances are open.
2) The server is open for SSH communication on the mapped port for SSH. You can try to use it's internal IP in case the public one didn't work well.
3) Check the Maintaining Jethro Manager page for more information.
About the Image Content
9100-9200 80 443 22