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 theapp.toml
in previous section)APP_DIR_NAME
: Application directory where Docker mounted volume is specified (-v
option indocker run
command). 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/oes
directory, and you want to mount and point APP_DIR_NAME
to it. Run the following command:
> docker run -d -p 80:80 -e APP_CONF=/server/app.toml -e APP_DIR_NAME=/server -v /home/joe/oes:/server oesinc/openfmb.hmi
A few things to note:
- The OpenFMB HMI docker container exposes port
80
. In this example, thedocker run
command above maps host port 80 to container port 80 (flag-p 80:80
). You can map any available port on your host system to the exposed port 32771. For example, if you want to map port8080
on your host system to80
, specify-p 8080:80
, and the command will be:
> docker run -d -p 8080:80 -e APP_CONF=/server/app.toml -e APP_DIR_NAME=/server -v /home/joe/oes:/server oesinc/openfmb.hmi
The
-v
orvolume
option specifies where the local directory is mounted.The first
-e
flag is theAPP_CONF
environment variable in the form ofAPP_CONF=/name_of_mounted_volume/path/to/the/config_file
(in our case, it isAPP_CONF=/server/app.toml
).The second
-e
flag is theAPP_DIR_NAME
environment variable in the form ofAPP_DIR_NAME=/name_of_mounted_volume
(in our case, it isAPP_DIR_NAME=/server
).
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
http://127.0.0.1
.The default username/pwd is
admin/hm1admin
.
Congratulations! You have run your first OpenFMB HMI application.