# How to bind a license to a Docker Container?

Applies to: QLM Enterprise

Version: 16.0.22152.2

***

### Overview

If you run your application within a docker container, QLM can bind the license to the hostname of the docker container.

### Configuration

There are two ways you can configure QLM to bind the license to a Docker Container:

* By setting the ELicenseBinding to QlmUniqueSystemIdentifier2
* By setting the ELicenseBinding to DockerContainer

![mceclip0.png](https://support.soraco.co/hc/article_attachments/6702318402708/mceclip0.png)

### Detection

To detect that your application is running in a Docker Container, QLM relies on the following environment variable: QLM\_RUNNING\_IN\_DOCKER\_CONTAINER

Therefore, when you create your Docker container image, you must set the QLM\_RUNNING\_IN\_DOCKER\_CONTAINER environment variable to True.

Example of a Dockerfile used to create an image:

<pre data-overflow="wrap"><code>FROM mcr.microsoft.com/dotnet/framework/runtime
WORKDIR /app
<strong>ENV QLM_RUNNING_IN_DOCKER_CONTAINER=true
</strong>COPY ./publish .
ENTRYPOINT ["/app/QlmCSharpConsoleAppSample.exe"]
</code></pre>

The following API is also available to detect if your application is running in a Docker Container (requires that your image sets the QLM\_RUNNING\_IN\_DOCKER\_CONTAINER environment variable): QlmHardware.RunningInDockerContainer()

Example:

{% code overflow="wrap" %}

```csharp
QlmHardware hw = new QlmHardware();
bool isRunningInDockerContainer = hw.RunningInDockerContainer ();
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.soraco.co/docs/how-to/how-to-bind-a-license-to-a-docker-container.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
