# docker **Repository Path**: mirrors_opencor/docker ## Basic Information - **Project Name**: docker - **Description**: A Docker file for running a CellML simulation and passing parameters through the command line. - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-25 - **Last Updated**: 2026-11-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Docker container for OpenCOR ============================ This [Docker](https://docker.com/) container can be used to run a simulation of a [CellML](https://www.cellml.org/) / [SED-ML](https://sed-ml.org/) file using [OpenCOR](https://opencor.ws/) through [Python](https://python.org/). You can either build the container yourself or use one of the prebuilt versions available on [Docker Hub](https://hub.docker.com/) at . A Docker image to execute CellML/SED-ML based [COMBINE archives](https://combinearchive.org/) using OpenCOR is available from [BioSimulators](https://biosimulators.org/simulators/opencor). Pull a prebuilt version of the container ---------------------------------------- docker pull opencor/opencor[:] where `` is the tag of a specific version (`yyyy-mm-dd`) or the latest version/snapshot (`latest`). If no tag is provided then the latest version/snapshot is assumed. (Only stable snapshots are used.) Build the container yourself ---------------------------- ### From GitHub #### Default version A default container can be built using: docker build -t opencor https://github.com/opencor/docker.git #### Specific version A container with a specific version of OpenCOR can be built using: docker build -t opencor --build-arg version= https://github.com/opencor/docker.git where `` can be either `x.y[.z]` (for an official version of OpenCOR) or `yyyy-mm-dd` (for a snapshot). Note that there is currently no official version of OpenCOR with Python support. ### From a clone If you clone the [GitHub repository](https://github.com/opencor/docker), you will not only be able to build a container with a default or a specific version of OpenCOR, but also a container based on a local archive of OpenCOR: docker build -t opencor --build-arg archive= where `` is the filename of a `.tar.gz` file located in ``, the directory where the GitHub directory was cloned. Run the container ----------------- ### Default docker run where `` is the name of the image (i.e. `opencor/opencor` if you pulled a prebuilt version of the container or `opencor` if you built it yourself), and `` is the URL of a CellML / SED-ML file, e.g. . This will run the CellML / SED-ML file and output the results for the variable of integration, as well as all the state variables in the model, this in a [JSON](https://json.org/) format. For example, for the above URL, we get: { "environment/t": [ 0.0, ..., 100.0 ], "membrane/V_m": [ -88.5901439103062, ..., -89.42705739292656 ], "fast_sodium_channel/fast_sodium_channel_m_gate/m": [ 0.0302964457761589, ..., 0.027969909786511916 ], "fast_sodium_channel/fast_sodium_channel_h_gate/h": [ 0.841520865130776, ..., 0.8560318033219113 ], "persistent_sodium_channel/persistent_sodium_channel_p_gate/p": [ 0.0969864645712442, ..., 0.11512881732943588 ], "slow_potassium_channel/slow_potassium_channel_s_gate/s": [ 0.00997371545602793, ..., 0.1297692977394969 ], "juxtaparanodal_fast_potassium_channel/juxtaparanodal_fast_potassium_channel_n_gate/n": [ 0.000886041197111556, ..., 0.000463917000795369 ] } ### Using a configuration file docker run -i < where `` is the filename of a configuration file in the JSON format, e.g. `config.json`: { "simulation": { "Starting point": 5, "Ending point": 50, "Point interval": 0.5 }, "parameters": { "fast_sodium_channel/g_Naf": 3.5, "membrane/V_m": -35 }, "output": [ "fast_sodium_channel/i_Naf", "leakage_channel/i_Lk", "membrane/V_m", "membrane/V_m/prime", "persistent_sodium_channel/i_Nap", "slow_potassium_channel/i_Ks" ] } The configuration file is used to configure the simulation (using the information in the `simulation` section, if present), customise the initial state of the model (using the information in the `parameters` section, if present). The simulation is then run and the variable of integration, as well as all the variables listed in the `output` section (if present otherwise all the state variables), are outputted. For example, for and the above configuration file, we get: { "environment/t": [ 5.0, ..., 50.0 ], "membrane/V_m": [ -35.0, ..., -72.4735314003255 ], "membrane/V_m/prime": [ -210.57350734894032, ..., 3.572051321498071 ], "fast_sodium_channel/i_Naf": [ -0.006961885968193237, ..., -0.3051159365312024 ], "leakage_channel/i_Lk": [ 0.385, ..., 0.12268528019772151 ], "persistent_sodium_channel/i_Nap": [ -0.0007754473404489828, ..., -0.701626253584342 ], "slow_potassium_channel/i_Ks": [ 0.04388434800652289, ..., 0.8769128072748268 ] } Note that rate variables have an identifier that ends with `/prime`, e.g. `membrane/V_m/prime` refers to the rate variable for the `membrane/V_m` state variable. Use the BioSimulators Docker image ---------------------------------- The BioSimulators Docker image can be obtained using: ``` docker pull ghcr.io/biosimulators/opencor ``` The image can be used to execute CellML/SED-ML based COMBINE archives using: ``` docker run -it --rm \ --mount type=bind,source=/path/to/in/dir,target=/tmp/in \ --mount type=bind,source=/path/to/out/dir,target=/tmp/out \ ghcr.io/biosimulators/opencor \ -i /tmp/in/archive.omex \ -o /tmp/out ``` All reports and plots described in the SED-ML files in the archive will be saved in [HDF5](https://en.wikipedia.org/wiki/Hierarchical_Data_Format) and [PDF](https://en.wikipedia.org/wiki/PDF) formats. More information about these formats is available at https://biosimulators.org/conventions/simulation-reports.