{"id":26129487,"url":"https://github.com/mathworks-ref-arch/polyspace-test-dockerfile","last_synced_at":"2026-02-17T06:05:37.079Z","repository":{"id":207187213,"uuid":"620650118","full_name":"mathworks-ref-arch/polyspace-test-dockerfile","owner":"mathworks-ref-arch","description":"Create a docker container that contains a Polyspace Test install","archived":false,"fork":false,"pushed_at":"2025-10-08T10:16:04.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-10-14T10:04:45.639Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathworks-ref-arch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-29T05:22:07.000Z","updated_at":"2025-10-08T10:16:07.000Z","dependencies_parsed_at":"2025-03-10T19:49:21.120Z","dependency_job_id":"9f49632e-6d5b-4a5a-bade-f54c0ac464e6","html_url":"https://github.com/mathworks-ref-arch/polyspace-test-dockerfile","commit_stats":null,"previous_names":["mathworks-ref-arch/polyspace-test-dockerfile"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mathworks-ref-arch/polyspace-test-dockerfile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks-ref-arch%2Fpolyspace-test-dockerfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks-ref-arch%2Fpolyspace-test-dockerfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks-ref-arch%2Fpolyspace-test-dockerfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks-ref-arch%2Fpolyspace-test-dockerfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathworks-ref-arch","download_url":"https://codeload.github.com/mathworks-ref-arch/polyspace-test-dockerfile/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks-ref-arch%2Fpolyspace-test-dockerfile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29535934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T05:00:25.817Z","status":"ssl_error","status_checked_at":"2026-02-17T04:57:16.126Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-10T19:49:07.097Z","updated_at":"2026-02-17T06:05:37.056Z","avatar_url":"https://github.com/mathworks-ref-arch.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Build and Customize a Polyspace Test Docker Image\n\nThis repository shows you how to build and customize a Docker image for Polyspace Test\u0026trade;, using the [MATLAB\u0026reg; Package Manager (*mpm*)](https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/main/MPM.md).\n\nYou can use this image as a scalable and reproducible method to run Polyspace Test command-line interfaces in containers.\n\n## Requirements\n\n* A valid Polyspace Test license\n* The port and host name of a [Network License Manager](https://www.mathworks.com/help/install/administer-network-licenses.html) or the path of a `network.lic` license file. See [Use Network License Manager](#use-network-license-manager).\n* Linux® Operating System\n* [Docker](https://docs.docker.com/engine/install/)\n* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n\n## Get Started\n\n### Get Sources and Build Docker Image\n\n Use these commands to clone this repository and build the Docker image:\n\n\u003e**Note:** If you use the `demo` files in the [Run Docker Container](#run-docker-container) example, uncomment one of these lines \u003cbr\u003e `# RUN apt-get install --no-install-recommends --yes gcc g++` (Ubuntu)\u003cbr\u003e`# RUN yum install --disableplugin=subscription-manager -y gcc gcc-c++` (UBI)\u003cbr\u003ein the `Dockerfile`, or check that you add the correct dependencies if you use a different compiler.\n\n```bash\n# Clone this repository to your machine.\ngit clone https://github.com/mathworks-ref-arch/polyspace-test-dockerfile.git\n\n# Navigate to the downloaded folder.\ncd polyspace-test-dockerfile\n\n# Select a base image for the container you want to build, for example, Ubuntu, and copy it to a Dockerfile.\ncp Dockerfile.ubuntu24.04 Dockerfile\n\n# Build container with a name and tag of your choice.\ndocker build . -t polyspace-test:r2025b\n```\n\nThe `build` command looks for the `Dockerfile` in the current directory and builds an image with the name and tag specified by the `-t` option.\n\nIf you list the docker images and filter for `polyspace*` after the `docker build` command completes, you see the polyspace-test image.\n\n```bash\n$ docker images -f=reference=polyspace*\nREPOSITORY       TAG       IMAGE ID       CREATED              SIZE\npolyspace-test   r2025b    9fd4db81b09e   About a minute ago   5.94GB\n```\n\n### Run Docker Container\n\nAfter you build the image, you can start using Polyspace Test by creating and running containers from the image you built in the previous section. To create and run a container, see the [`docker run`](https://docs.docker.com/engine/reference/commandline/run/) command.\n\nFor example, you can test your installation by running the script in the `demo` folder. The folder contains:\n\n* A source file `file.c` which defines a function to test.\n* A test file `test.c` which contains a test written using the [Polyspace Test xUnit API](https://www.mathworks.com/help/polyspace_test/gs/write-simple-c-or-c-unit-test-using-polyspace-test-api.html).\n* A script file `demo_script.sh` which performs these steps:\n  1. Test registration, which generates a file that contains a registration function for the test and a `main()` function to call the test.\n  1. Test building and running, which builds the test, generates a test runner, runs the test, and outputs the results in the terminal.\n\nTo run the `demo` example, enter these commands:\n\n```bash\n# Change permissions for demo folder\nchmod 777 demo\ncd demo\n# Build container and run demo script\ndocker run --rm -v \"$(pwd):/work\" \\\n-e MLM_LICENSE_FILE=27000@MyServerName.example.com \\\npolyspace-test:r2025b /work/demo_script.sh\n```\n\nAfter running the test, you see an output similar to this in the terminal:\n\n```bash\n| Running tests   |            |                      | 2023-10-06 17:01:08\n|-----------------|------------|\n| Running         | suite      | pst_default_suite\n|-----------------|------------|\n| Running         | test       | test_sum_correct\n|            PASS | test       | test_sum_correct     | time: 0.000s\n|-----------------|------------|\n|            PASS | suite      | pst_default_suite    | time: 0.000s\n|-----------------|------------|\n|            DONE |            |                      | time: 0.000s\n\n|        |  Total | Passed | Failed | Incomplete\n|--------|--------|--------|--------|------------\n| Suites |      1 |      1 |      0 |          0\n|  Tests |      1 |      1 |      0 |          0\n```\n\nDocker automatically cleans up each container and removes its file system when that container exits (`--rm` option).\n\n## Customize Docker Image\n\nThe [Dockerfile](https://github.com/mathworks-ref-arch/polyspace-test-dockerfile/blob/main/Dockerfile) supports these Docker build-time variables.\n\n| Argument Name | Default value | Description |\n|---|---|---|\n| MATLAB_RELEASE | r2025b | The Polyspace Test release you want to install. Must be lower-case, for example: `r2024b`.|\n| [LICENSE_SERVER](#specify-license-server-information-in-build-image) | *unset* | The port and hostname of the machine that is running the Network License Manager, using the `port@hostname` syntax. For example: `27000@MyServerName`. |\n\nTo customize the docker image, use these arguments with the `docker build` command or edit the default values of these arguments directly in the [Dockerfile](https://github.com/mathworks-ref-arch/polyspace-test-dockerfile/blob/main/Dockerfile).\n\n### Examples\n\n#### **Specify License Server Information in Build Image**\n\nIf you include the [license manager information](#obtain-license-manager-information) when you run the `docker build` command, you do not have to specify the `MLM_LICENSE_FILE` variable when you run the container using the `docker run` command.\n\n```bash\n# Build container and specify LICENSE_SERVER variable\ndocker build -t polyspace-test:r2025b --build-arg LICENSE_SERVER=27000@MyServerName.example.com .\n\n# Run the container without specifying the MLM_LICENSE_FILE variable\ndocker run --rm -v \"$(pwd):/work\" \\\npolyspace-test:r2025b /work/demo_script.sh\n```\n\n\u003e **Note**: If you specify the value of the LICENSE_SERVER variable in the Dockerfile, you can omit it when running the `docker build` command.\n\u003e\n## Use Network License Manager\n\nThe Polyspace Test product uses a concurrent license which requires a Network License Manager to manage license checkouts.\n\nTo enable the container to communicate with the license manager, you must provide the port and hostname of the machine where you installed the license manager or the path to the  `network.lic` file.\n\n### Obtain License Manager Information\n\nContact your license administrator to obtain the address of your license server, for instance:\n\n `27000@MyServerName.example.com`, or the path to the `network.lic` file.\n\nYou can also get the license manager port and hostname from the `SERVER` line of the `network.lic` file or the `license.dat` file.\n\n```bash\n# Sample network.lic\nSERVER MyServerName.example.com \u003coptional-mac-address\u003e 27000\nUSE_SERVER\n\n# Snippet from sample license.dat\nSERVER MyServerName.example.com \u003cmac-address\u003e 27000\n...\n```\n\n### Pass License Manager Information to `build` or `run` Commands\n\nTo pass the license manager address (`portNumber@hostname`) to the:\n\n* `docker build` command, assign the address to the [LICENSE_SERVER](#specify-license-server-information-in-build-image) build variable.\n* `docker run` command, assign the address to the [MLM_LICENSE_FILE](#run-docker-image) environment variable.\n\nTo use the `network.lic` file instead:\n\n1. Copy the file to the same folder as the `Dockerfile`.\n1. Uncomment the line `COPY network.lic /opt/matlab/licenses/` in the Dockerfile.\n\n    You do not need to specify the `LICENSE_SERVER` build variable when running the `docker build` command:\n\n    ```bash\n    # Example\n    docker build -t polyspace-test:r2025b .\n    ```\n\n## Remove Docker Image\n\nWhile docker cleans up containers on exit, the docker image persists in your file system until you explicitly delete it. To delete a docker image, run the `docker image rm` command and specify the name of the container. For instance:\n\n```bash\ndocker image rm polyspace-test:r2025b\n```\n\n---\n\n## More MathWorks Docker Resources\n\n* Explore prebuilt MATLAB Docker Containers on [Docker Hub](https://hub.docker.com/r/mathworks):\n  * [MATLAB Containers on Docker Hub](https://hub.docker.com/r/mathworks/matlab) hosts container images for multiple MATLAB releases.\n  * [MATLAB Deep Learning Container Docker Hub repository](https://hub.docker.com/r/mathworks/matlab-deep-learning) hosts container images with toolboxes suitable for deep learning.\n\n## Feedback\n\nIf you encounter a technical issue or have an enhancement request after trying this repository with your environment, create an issue [here](https://github.com/mathworks-ref-arch/polyspace-test-dockerfile/issues).\n\n---\n\nCopyright (c) 2023-2025 The MathWorks, Inc. All rights reserved.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathworks-ref-arch%2Fpolyspace-test-dockerfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathworks-ref-arch%2Fpolyspace-test-dockerfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathworks-ref-arch%2Fpolyspace-test-dockerfile/lists"}