> For the complete documentation index, see [llms.txt](https://docs.zama.org/concrete-ml/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zama.org/concrete-ml/1.2/developer-guide/api/concrete.ml.deployment.deploy_to_docker.md).

# concrete.ml.deployment.deploy\_to\_docker.md

[![](https://img.shields.io/badge/-source-cccccc?style=flat-square)](https://github.com/zama-ai/concrete-ml/blob/release/1.2.x/src/concrete/ml/deployment/deploy_to_docker.py#L0)

## module `concrete.ml.deployment.deploy_to_docker`

Methods to deploy a server using Docker.

It takes as input a folder with: - client.zip - server.zip - processing.json

It builds a Docker image and spawns a Docker container that runs the server.

This module is untested as it would require to first build the release Docker image. FIXME: <https://github.com/zama-ai/concrete-ml-internal/issues/3347>

### **Global Variables**

* **DATE\_FORMAT**

***

[![](https://img.shields.io/badge/-source-cccccc?style=flat-square)](https://github.com/zama-ai/concrete-ml/blob/release/1.2.x/src/concrete/ml/deployment/deploy_to_docker.py#L25)

### function `delete_image`

```python
delete_image(image_name: str)
```

Delete a Docker image.

**Arguments:**

* `image_name` (str): to name of the image to delete.

***

[![](https://img.shields.io/badge/-source-cccccc?style=flat-square)](https://github.com/zama-ai/concrete-ml/blob/release/1.2.x/src/concrete/ml/deployment/deploy_to_docker.py#L38)

### function `stop_container`

```python
stop_container(image_name: str)
```

Kill all containers that use a given image.

**Arguments:**

* `image_name` (str): name of Docker image for which to stop Docker containers.

***

[![](https://img.shields.io/badge/-source-cccccc?style=flat-square)](https://github.com/zama-ai/concrete-ml/blob/release/1.2.x/src/concrete/ml/deployment/deploy_to_docker.py#L51)

### function `build_docker_image`

```python
build_docker_image(path_to_model: Path, image_name: str)
```

Build server Docker image.

**Arguments:**

* `path_to_model` (Path): path to serialized model to serve.
* `image_name` (str): name to give to the image.

***

[![](https://img.shields.io/badge/-source-cccccc?style=flat-square)](https://github.com/zama-ai/concrete-ml/blob/release/1.2.x/src/concrete/ml/deployment/deploy_to_docker.py#L83)

### function `main`

```python
main(path_to_model: Path, image_name: str)
```

Deploy function.

* Builds Docker image.
* Runs Docker server.
* Stop container and delete image.

**Arguments:**

* `path_to_model` (Path): path to model to server
* `image_name` (str): name of the Docker image


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zama.org/concrete-ml/1.2/developer-guide/api/concrete.ml.deployment.deploy_to_docker.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
