In order to pass your API keys to the docker container, they must first be set in a local file. In the main repository, there is a file with predefined keys and terminal settings setenv. This can be downloaded or created on your own
The file should contain something such as:
DISPLAY=
OPENBB_API_KEY_FINANCIALMODELINGPREP=qwerty123456
...
OPENBB_API_POLYGON_KEY=qwerty123456
OPENBB_API_FRED_KEY=qwerty123456
HDF5_DISABLE_VERSION_CHECK=2
OPENBB_ENABLE_PREDICT=True
OPENBB_ENABLE_THOUGHTS_DAY=False
OPENBB_USE_PROMPT_TOOLKIT=True
OPENBB_USE_ION=True
where 'qwerty123456' corresponds to each individual API key. Note:
- Unlike API keys in config_terminal, these keys DO NOT use " ".
- This file is sensible to white spaces. Therefore, make sure there isn't an additional white space at the end of the key, otherwise it won't work.
In order to run the docker container with the environment variables, make sure to edit with whatever keys you have and
then run the container (path/to/setenv
) should be replaced with wherever this file was created). If you have
downloaded the entire repository and your current directory is OpenBBTerminal
, then the path would be docker/setenv
docker run -it --rm --env-file=path/to/setenv ghcr.io/openbb-finance/openbbterminal-poetry:latest
In order to display plots in the docker container, we can configure our XServer.
Users familiar with Docker and X-Server can set the DISPLAY
variable in the file setenv described
above. If you use this approach remember to add :0
at the end of your inet address. E.g. DISPLAY=192.168.1.155:0
.
For help setting up the X-Server, I will go through this now:
- Install X Quartz from https://www.xquartz.org/
- With X Quartz open: go to Preferences -> Security and make sure both options are enabled.
From the command prompt or terminal, run the following to add your local configuration to the list of allowed access control:
IP=$(ifconfig | grep inet | grep -v -e "127.0.0.1" | awk '$1=="inet" {print $2}')
xhost + $IP
Now we can run the docker container, adding the display to the environment:
docker run -it --rm --env-file=path/to/setenv -e DISPLAY=$IP:0 ghcr.io/OpenBBTerminal/gst-poetry:latest
This container will be able to display all the same plots as the terminal interface.
X-Server is default in Linux distribution, and it's no need to install any client in Desktop.
We can use IPC socket to connect Desktop.
Add this setting to your .env
file.
OPENBB_BACKEND=Qt5Agg
And run the following commands.
xhost +local:
docker run -it --rm --name openbb --env-file=./.env -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix ghcr.io/openbb-finance/openbbterminal-poetry:latest
xhost -local:
If you're using remote docker host, you can connect with "ssh -X <FQDN/IP>".
Then run the previous docker command.