Run the HMI
To run the OpenFMB HMI Docker image, we need to pass in two environment variables:
APP_CONF: Path to application configuration file (in our case, it is the
app.tomlin previous section)
APP_DIR_NAME: Application directory where Docker mounted volume is specified (
docker runcommand). This directory is where all single-line diagrams that you create later in this tutorial will be stored.
Suppose that you created the
app.toml file in
/home/joe/hmi directory, and you want to mount and point
APP_DIR_NAME to it. Run the following command:
> docker run -d -p 32771:32771 -e APP_CONF=/server/app.toml -e APP_DIR_NAME=/server -v /home/joe/oes:/server openfmb.hmi
A few things to note:
- The OpenFMB HMI docker container exposes port
32771. In this example, the
docker runcommand above maps host port 32771 to container port 32771 (flag
-p 32771:32771). You can map any available port on your host system to the exposed port 32771. For example, if you want to map port
80on your host system to
p 80:32771, and the command will be:
> docker run -d -p 80:32771 -e APP_CONF=/server/app.toml -e APP_DIR_NAME=/server -v /home/joe/oes:/server openfmb.hmi
volumeoption specifies where the local directory is mounted.
-eflag is the
APP_CONFenvironment variable in the form of
APP_CONF=/name_of_mounted_volume/path/to/the/config_file(in our case, it is
-eflag is the
APP_DIR_NAMEenvironment variable in the form of
APP_DIR_NAME=/name_of_mounted_volume(in our case, it is
TIP: Our named volume is `/server`, therefore, "name_of_mounted_volume" is replaced with "server".
You can name it anything you want.
Launch your favorite browser, and navigate to
The default username/pwd is
Congratulations! You have run your first OpenFMB HMI application.