clearml-docs/docs/clearml_agent/clearml_agent_docker.md

47 lines
1.6 KiB
Markdown
Raw Normal View History

2024-07-15 12:53:41 +00:00
---
title: Building Docker Containers
---
## Exporting a Task into a Standalone Docker Container
### Task Container
2025-02-06 15:31:11 +00:00
Build a Docker container that when launched executes a specific task, or a clone (copy) of that task.
2024-07-15 12:53:41 +00:00
- Build a Docker container that at launch will execute a specific Task:
```bash
clearml-agent build --id <task-id> --docker --target <new-docker-name> --entry-point reuse_task
```
- Build a Docker container that at launch will clone a Task specified by Task ID, and will execute the newly cloned Task:
```bash
clearml-agent build --id <task-id> --docker --target <new-docker-name> --entry-point clone_task
```
- Run built Docker by executing:
```bash
docker run <new-docker-name>
```
2025-02-06 15:31:11 +00:00
Check out [this tutorial](../guides/clearml_agent/executable_exp_containers.md) for building executable task
2024-07-15 12:53:41 +00:00
containers.
### Base Docker Container
Build a Docker container according to the execution environment of a specific task.
```bash
clearml-agent build --id <task-id> --docker --target <new-docker-name>
```
2025-02-06 15:31:11 +00:00
You can add the Docker container as the base Docker image to a task, using one of the following methods:
2024-07-15 12:53:41 +00:00
2025-02-10 08:17:24 +00:00
- Using the **ClearML Web UI** - See [Default Container](../webapp/webapp_exp_tuning.md#default-container).
2024-07-15 12:53:41 +00:00
- In the ClearML configuration file - Use the ClearML configuration file [`agent.default_docker`](../configs/clearml_conf.md#agentdefault_docker)
options.
Check out [this tutorial](../guides/clearml_agent/exp_environment_containers.md) for building a Docker container
replicating the execution environment of an existing task.