Skip to main content

Using Docker

  1. Install Docker on your device.

  2. Pull image:

    docker pull silianz/python-openbmclapi:latest
    info

    You can also pull with mirror sources:

    docker pull registry.cn-hangzhou.aliyuncs.com/silianz/python-openbmclapi:latest
  3. Create a container:

    docker run -d \
    -v /path/to/your/cache:/opt/python-openbmclapi/bmclapi \
    -e cluster.id=${cluster.id} \
    -e cluster.secret=${cluster.secret} \
    -e cluster.public_port=${cluster.public_port} \
    -p ${cluster.public_port}:8080 \
    --restart always \
    --name python-openbmclapi \
    silianz/python-openbmclapi

    Parameter description:

    cluster.public_port - Port open to others.

    cluster.id - i.e. CLUSTER_ID.

    cluster.secret - i.e. CLUSTER_SECRET.

info

For other configuration parameters, see Configuration File. Use Namespace ID to pass the corresponding configurations into the Docker container as environment variables.

In certain specific cases, you may not be able to transfer some configuration parameters into the container. You can try to mount the configuration file by adding this parameter to the command:

-v /path/to/your/config/file:/opt/python-openbmclapi/config/config.yml
Namespace ID

Namespace ID is a way to pass configuration parameters into a Docker container.

config/config.yml
dashboard:
password: ""
username: admin
websocket: true

This is an example configuration parameter. If we want to convert these configurations into Namespace ID, it will be like this:

dashboard.password=""
dashboard.user=admin
dashboard.websocker=true

Use . to connect the key and value of the configuration parameter when converting the configuration to a Namespace ID.