Skip to content
Closed
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
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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/*
Comment on lines +3 to +6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is nothing Vulkan-specific here though, just a typical boilerplate


# 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"]
18 changes: 18 additions & 0 deletions docs/src/building-rust-gpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down