Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 21 additions & 17 deletions docs/blog/posts/docker-inside-containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,26 @@ To run containers with `dstack`, you can use your own Docker image (or the defau
directly with Docker. However, some existing code may require direct use of Docker or Docker Compose. That's why,
in our latest release, we've added this option.

<div editor-title="examples/misc/docker-compose/task.dstack.yml">
```yaml
<div editor-title="task.dstack.yml">

```yaml
type: task
name: chat-ui-task
name: compose-task

image: dstackai/dind
privileged: true

working_dir: examples/misc/docker-compose
commands:
- start-dockerd
- |
cat > compose.yaml <<'EOF'
services:
web:
image: python:3.11-slim
command: python -m http.server 9000
ports:
- "9000:9000"
EOF
- docker compose up
ports: [9000]

Expand All @@ -37,15 +45,15 @@ resources:

## How it works

To use Docker or Docker Compose with your `dstack` configuration, set `image` to `dstackai/dind`, `privileged` to
To use Docker or Docker Compose with your `dstack` configuration, set `image` to `dstackai/dind`, `privileged` to
`true`, and add the `start-dockerd` command. After this command, you can use Docker or Docker Compose directly.


For dev environments, add `start-dockerd` as the first command
in the `init` property.

??? info "Dev environment"
<div editor-title="examples/misc/docker-compose/.dstack.yml">
<div editor-title=".dstack.yml">

```yaml
type: dev-environment
Expand All @@ -59,7 +67,7 @@ in the `init` property.
- start-dockerd

resources:
gpu: 16GB..24GB
gpu: 16GB..24GB
```

</div>
Expand All @@ -71,15 +79,15 @@ With this setup, you don’t have to worry about configuration—both Docker and
support GPU usage.

!!! info "Backends"
Note that the `privileged` option is only supported by VM-based backends. This does not include `runpod`, `vastai`,
Note that the `privileged` option is only supported by VM-based backends. This does not include `runpod`, `vastai`,
and `kubernetes`. All other backends support it.

## When using it

### docker compose

One of the obvious use cases for this feature is when you need to use Docker Compose.
For example, the Hugging Face Chat UI requires a MongoDB database, so using Docker Compose to run it is
One of the obvious use cases for this feature is when you need to use Docker Compose.
For example, the Hugging Face Chat UI requires a MongoDB database, so using Docker Compose to run it is
the easiest way:

<img src="https://dstack.ai/static-assets/static-assets/images/dstack-docker-compose-terminal.png" width="750"/>
Expand All @@ -92,14 +100,10 @@ Another use case for this feature is when you need to build a custom Docker imag

Last but not least, you can, of course, use the `docker run` command, for example, if your existing code requires it.

## Examples

A few examples of using this feature can be found in [`examples/misc/docker-compose`](https://github.com/dstackai/dstack/blob/master/examples/misc/docker-compose).

## Feedback

If you find something not working as intended, please be sure to report it to
our [bug tracker](https://github.com/dstackai/dstack/issues){:target="_ blank"}.
Your feedback and feature requests are also very welcome on both
our [bug tracker](https://github.com/dstackai/dstack/issues){:target="_ blank"}.
Your feedback and feature requests are also very welcome on both
[Discord](https://discord.gg/u8SmfwPpMd) and the
[issue tracker](https://github.com/dstackai/dstack/issues).
2 changes: 0 additions & 2 deletions docs/blog/posts/nvidia-and-amd-on-vultr.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ projects:
For more details, refer to [Installation](../../docs/installation.md).
> Interested in fine-tuning or deploying DeepSeek on Vultr? Check out the corresponding [example](../../examples/llms/deepseek/index.md).
!!! info "What's next?"
1. Refer to [Quickstart](../../docs/quickstart.md)
2. Sign up with [Vultr](https://www.vultr.com/)
Expand Down
8 changes: 4 additions & 4 deletions docs/blog/posts/volumes-on-runpod.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ deploying a model on Runpod.

Suppose you want to deploy Llama 3.1 on Runpod as a [service](../../docs/concepts/services.md):

<div editor-title="examples/llms/llama31/tgi/service.dstack.yml">
<div editor-title="service.dstack.yml">

```yaml
type: service
Expand Down Expand Up @@ -63,7 +63,7 @@ Great news: Runpod supports network volumes, which we can use for caching models

With `dstack`, you can create a Runpod volume using the following configuration:

<div editor-title="examples/mist/volumes/runpod.dstack.yml">
<div editor-title="runpod-volume.dstack.yml">

```yaml
type: volume
Expand All @@ -83,15 +83,15 @@ Go ahead and create it via `dstack apply`:
<div class="termy">

```shell
$ dstack apply -f examples/mist/volumes/runpod.dstack.yml
$ dstack apply -f runpod-volume.dstack.yml
```

</div>

Once the volume is created, attach it to your service by updating the configuration file and mapping the
volume name to the `/data` path.

<div editor-title="examples/llms/llama31/tgi/service.dstack.yml">
<div editor-title="service.dstack.yml">

```yaml
type: service
Expand Down
Loading
Loading