Files
OpenBB/DOCKER_ADVANCED.md
Colin Delahunty 926508c5ca Docker Volume Support and Remove the Last of the Files (Last Docker PR I Promise) (#2715)
* Added fixes

* Added fixes to readme

* Added fixes to readme

* Removed unneeded files

* Final fixes, we ready

* Removing docker/lab-settings.json

* Docker : update doc

* Added fixes

* Added fixes

* Added fixes

Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
2022-10-06 10:39:37 +02:00

1.9 KiB
Vendored

Docker Advanced Settings

Display

In order to display plots in the docker container, we can configure our XServer.

X-Server on macOS

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:

Setting up X Quartz/X11

  1. Install X Quartz from https://www.xquartz.org/
  2. With X Quartz open: go to Preferences -> Security and make sure both options are enabled. Screen Shot 2021-09-08 at 12 21 48 PM

Adding the display for Docker

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 on Linux Desktop

X-Server is default in Linux distribution, and it's no need to install any client in Desktop.

Local docker container

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.