main
md 62 lines 2.19 KB
Rendered Raw
1 # Dockerfile
2
3 We provide a [docker/Dockerfile](../../../docker/Dockerfile) to construct the image for running an OpenAI compatible server with vLLM.
4 More information about deploying with Docker can be found [here](../../deployment/docker.md).
5
6 Below is a visual representation of the multi-stage Dockerfile. The build graph contains the following nodes:
7
8 - All build stages
9 - The default build target (highlighted in grey)
10 - External images (with dashed borders)
11
12 The edges of the build graph represent:
13
14 - `FROM ...` dependencies (with a solid line and a full arrow head)
15
16 - `COPY --from=...` dependencies (with a dashed line and an empty arrow head)
17
18 - `RUN --mount=(.\*)from=...` dependencies (with a dotted line and an empty diamond arrow head)
19
20 The `test-deps` stage branches from `vllm-runtime-base` so Git and the test
21 requirements remain cached independently of per-commit vLLM wheels and source.
22
23 The `extensions-build` stage can also produce an optional source-built Triton
24 wheel. `vllm-openai-base` installs that wheel after its other Python
25 dependencies so dependency resolution cannot restore an older Triton version.
26
27 > <figure markdown="span">
28 > ![](../../assets/contributing/dockerfile-stages-dependency.png){ align="center" alt="query" width="100%" }
29 > </figure>
30 >
31 > Made using: <https://github.com/patrickhoefler/dockerfilegraph>
32 >
33 > Commands to regenerate the build graph (make sure to run it **from the \`root\` directory of the vLLM repository** where the dockerfile is present):
34 >
35 > ```bash
36 > dockerfilegraph \
37 > -o png \
38 > --concentrate \
39 > --legend \
40 > --dpi 200 \
41 > --max-label-length 50 \
42 > --filename docker/Dockerfile
43 > ```
44 >
45 > or in case you want to run it directly with the docker image:
46 >
47 > ```bash
48 > docker run \
49 > --rm \
50 > --user "$(id -u):$(id -g)" \
51 > --workdir /workspace \
52 > --volume "$(pwd)":/workspace \
53 > ghcr.io/patrickhoefler/dockerfilegraph:alpine \
54 > --output png \
55 > --dpi 200 \
56 > --max-label-length 50 \
57 > --filename docker/Dockerfile \
58 > --concentrate \
59 > --legend
60 > ```
61 >
62 > (To run it for a different file, you can pass in a different argument to the flag `--filename`.)