From 8651bd5abcc109b09a9394d7197e478987b13916 Mon Sep 17 00:00:00 2001 From: Claus Mouse <11484197-senoraraton@users.noreply.gitlab.com> Date: Fri, 10 Oct 2025 16:46:58 -0700 Subject: [PATCH 1/2] Dockerfile init --- Dockerfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..091812df29 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM debian:bookworm-slim AS build + +RUN apt-get update && apt-get install -y \ + curl ca-certificates build-essential pkg-config \ + libssl-dev clang \ + && rm -rf /var/lib/apt/lists/* + +# Install rustup +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal +ENV PATH="/root/.cargo/bin:${PATH}" + +WORKDIR /app +COPY . . + +ENV CC=gcc +ENV Cxx=g++ +ENV PKG_CONFIG_PATH=/usr/lib/pkgconfig + +RUN cargo fetch + +CMD ["/bin/bash"] From 845c4f5b7913f06aadd554e106dd636cd0da1426 Mon Sep 17 00:00:00 2001 From: Claus Mouse <11484197-senoraraton@users.noreply.gitlab.com> Date: Fri, 10 Oct 2025 17:12:05 -0700 Subject: [PATCH 2/2] Added dockerfile build to wiki --- docs/src/building-rust-gpu.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/src/building-rust-gpu.md b/docs/src/building-rust-gpu.md index 0900a102d8..bba7008b27 100644 --- a/docs/src/building-rust-gpu.md +++ b/docs/src/building-rust-gpu.md @@ -39,6 +39,24 @@ cargo run \ You should see `warning: use-installed-tools feature on, skipping compilation of C++ code` during the compilation, but otherwise the build will function just the same as if you compiled the C++ code, with the exception that it will fail if you don't have SPIRV-Tools installed correctly. +## Docker Image + +The repo root contains a Dockerfile that builds rust-gpu and also provides the configured development environment. + +To build it, clone the repository and run the following in the root of the repository. + +```shell +docker build -t rust-gpu-dev . +``` + +To access the container: +```shell +docker run -it --name rust-gpu-dev rust-gpu-dev bash +``` + +The container builds from the current source directory. If you make local changes, and then rebuild those changes will be reflected in the new container image. + + [spirv-builder]: https://rust-gpu.github.io/rust-gpu/api/spirv_builder/index.html [examples]: https://github.com/rust-gpu/rust-gpu/tree/main/examples [examples/runners]: https://github.com/rust-gpu/rust-gpu/tree/main/examples/runners