# 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.1.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.1.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.1.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.1.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.1.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: 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.zama.org/concrete-ml/1.1/developer-guide/api/concrete.ml.deployment.deploy_to_docker.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.
