This Docker image provides the DirectX Compiler (DXC) with flexible version selection, allowing you to specify which version of DXC you want to use at runtime.
- Supports DXC versions from 1.7 to the latest available on GitHub
- Version selection via runtime arguments (
--v=1.8.2405) - Usable both directly and as a base image in other Dockerfiles
- Automatically downloads and caches requested versions
- Exposes
dxcin PATH for easy access
Run DXC with the default version:
docker run jasongardner/dxc [DXC_ARGS...]Specify a different version at runtime:
docker run jasongardner/dxc --v=1.8.2405 [DXC_ARGS...]Example: Compile a shader with a specific version:
docker run -v $(pwd):/work -w /work jasongardner/dxc --v=1.8.2405 -T ps_6_0 -E main shader.hlsl -Fo shader.binYou can use this image as a base in your own Dockerfile:
FROM jasongardner/dxc:latest
# dxc now in PATHOr specify a version in your derived image:
FROM jasongardner/dxc:1.7To use dxc in the next build stages:
FROM jasongardner/dxc:latest AS dxc
RUN dxc --version
# (Example base image)
FROM python:3.11-slim AS base
# Copy from previous step and add to path
COPY --from=dxc /opt/dxc /opt/dxc
ENV PATH="/opt/dxc/bin:$PATH"The following DXC versions are supported:
- 1.8.2502 (February 2025)
- 1.8.2407 (July 2024)
- 1.8.2405 (May 2024)
- 1.8.2403.2 (April 2024)
- 1.8.2403.1 (March 2024)
- 1.8.2403 (March 2024)
- 1.8.2306-preview (June 2023)
- 1.7.2308 (August 2023)
- 1.7.2212 (December 2022)
- 1.7.2207 (July 2022)
To build the Docker image:
docker build -t jasongardner/dxc:latest .You can specify a default DXC version during build time:
docker build --build-arg DXC_VERSION=1.7.2308 -t jasongardner/dxc:1.7 .This Docker image is provided under the same license as the DirectX Shader Compiler. See the DirectX Shader Compiler repository for details.