主要内容

Install Polyspace Access using Docker Compose

R2026b

Use Docker Compose to install and manage the Polyspace® Access™ services. The Docker Compose installation uses an .env file where you configure all settings for your installation. You then use standard docker compose commands to start and stop the services.

Docker Prerequisites

Installing Polyspace Access with Docker Compose has these prerequisites:

  • You are using Docker API version 1.44 or later. To force Docker® to use the correct API version, set the environment variable DOCKER_API_VERSION to 1.44 or later. For more information, see Docker Engine API.

  • Docker Engine is installed and running on your Linux® server. At the command line, enter:

    docker ps

    If you get an error, run sudo systemctl start docker. If systemctl is not available, use service instead.

  • Docker Compose is installed. To check installation, enter:

    docker compose version
  • You are logged in as a member of the docker group. To check current members, enter:

    grep 'docker' /etc/group

    To add the current user to the docker group, use this command:

    sudo usermod -aG docker $USER

Get the Docker Images

  1. Go to the MathWorks® Downloads page.

  2. From the I Want To list, select Install Products to install a new version of Polyspace Access, or Get Updates to install an update.

  3. Expand the Get Polyspace Access Web Server section and click Download.

  4. Unzip the downloaded file:

    unzip polyspace-access-VERSION.zip

    Here, VERSION is the release version, for instance R2026b.

    The compose folder contains the docker-compose.yaml file and service configuration folders:

    compose/
    ├── docker-compose.yaml
    ├── gateway/
    ├── issuetracker/
    ├── polyspace-access/
    └── usermanager/
    
    When you start docker services with docker compose up command, the installation pulls any required Docker images from the MathWorks public registry.

Prepare the Installation Folder

Before running Polyspace Access, prepare the installation folder by providing the certificates and license files that Polyspace Access requires. Locate the .env file in the compose folder that you extracted from the installation image. This .env file contains all configuration settings for your Polyspace Access installation.

For security purposes, you can use the command chmod 400 .env to restrict file access to the file owner only. You can also do this for any private key file the .env file references, as long as the user running Docker Compose owns the files or has read access to the files.

  1. In the .env file, in the General settings section, set the INSTALL_DIR variable to the root folder you want to use for your Polyspace Access installation. By default, this location is set to INSTALL_DIR=${HOME}/polyspace-access.

  2. Create the installation folder on your machine in the location you set in the previous step. For example, if you use the default location, navigate to /home/username and create the folder polyspace-access. Then, in the polyspace-access folder, create subfolders certs and data.

  3. Copy the um-key.pem file to the certs subfolder of the installation folder. You can create this private key file using the openssl utility. For more information on how to create this key, see the USERMANAGER_SSL_KEY_FILE variable on Admins.

  4. Copy your license file (license.dat or license.lic) to the installation folder, and update the LICENSE_FILE variable in the .env file if needed:

    LICENSE_FILE=${INSTALL_DIR}/license.dat
    For more information, see Configure Polyspace Access License.

Configure the .env File

Configure your Polyspace Access installation by editing variables in the .env file. The .env file is located in the compose folder that you extracted from the installation image.

Docker Compose Profiles

Docker Compose profiles control which services are started when starting Polyspace Access. Set the COMPOSE_PROFILES variable in the .env file to one or more of these profiles, separated by commas:

ProfileDescription
localdb_all Start bundled local PostgreSQL containers for all databases. This is the default profile.
localdb_data Start bundled local PostgreSQL container for the Polyspace Access data database only.
localdb_users Start bundled local PostgreSQL container for the User Manager database only.
issuetracker Start optional issue tracker services.

For instance, to use local databases for all services and enable the issue tracker, use this assignment

COMPOSE_PROFILES=localdb_all,issuetracker

General Settings

These variables in the table define the directory structure and restart behavior for your Polyspace Access installation. All other path variables in the .env file are derived from these values.

VariableDescriptionDefault
INSTALL_DIR Root directory for the Polyspace Access installation. ${HOME}/polyspace-access
CERT_DIR Directory for certificate files. ${INSTALL_DIR}/certs
DATA_DIR Directory for data storage. ${INSTALL_DIR}/data
LICENSE_FILE Path to the license file. ${INSTALL_DIR}/license.dat
RESTART_POLICY Container restart policy. For more information about setting a restart policy for your Docker containers, see Start containers automatically in the Docker documentation. always

Gateway Settings

The gateway handles all communications between client machines and the Polyspace Access services. Set these variables to define the protocol, hostname, and port that clients use to connect to Polyspace Access.

VariableDescriptionDefault
GATEWAY_PROTOCOL Protocol used by the gateway, specified as http or https http
GATEWAY_HOSTNAME Hostname for the gateway localhost
GATEWAY_PORT Port used by the gateway 8080

If you set GATEWAY_PROTOCOL to https, you must also configure the following SSL variables. Place all certificate files in the ${CERT_DIR} directory.

VariableDescription
GATEWAY_SSL_KEY_FILE Name of the SSL private key PEM file
GATEWAY_SSL_CERT_FILE Name of the SSL certificate PEM file
GATEWAY_SSL_CA_FILE Name of the certificate authority (CA) PEM file

Configure Services

In addition to the settings and variables above, Polyspace Access requires you to configure settings for its individual services. Configure each service by editing the corresponding variables in the .env file:

After you configure the .env file, start and verify the services. See Start and Stop Polyspace Access Services.

See Also

|

Topics