DirectorySecurity AdvisoriesPricing
Sign inTry Starter for free
Directory
sglang logo

sglang

packaged by Chainguard

Last changed
Start with 5 free container images

Catalog Starter gives your team 5 production-grade container images, free forever, with no contract or sales call. Sign up with your work email.

Try Starter for free
Tags
Overview
Comparison
Provenance
Specifications
SBOM
Vulnerabilities
Advisories

Chainguard Container for sglang

SGLang is a high-performance serving framework for large language models and multimodal models, with an OpenAI-compatible API server, RadixAttention prefix caching, and GPU acceleration.

Chainguard Containers are regularly-updated, secure-by-default container images.

Download this Container Image

For those with access, this container image is available on cgr.dev:

docker pull cgr.dev/ORGANIZATION/sglang:latest

Be sure to replace the ORGANIZATION placeholder with the name used for your organization's private repository within the Chainguard Registry.

Compatibility Notes

The sglang image is designed as a drop-in replacement for the upstream lmsysorg/sglang CUDA 13.0 runtime image (lmsysorg/sglang:<version>-cu130-runtime). The following match upstream, so existing docker run commands, Compose files, and Kubernetes manifests work once their cache volumes move from /root to /home/nonroot:

  • Layout. The virtual environment is /opt/sglang, first on PATH, so bare python3, sglang, and sgl-model-gateway are SGLang's, and /usr/bin/python and /usr/bin/python3 run the venv interpreter. The work directory /sgl-workspace/sglang is the SGLang source at the release tag, with python/sglang linked to the installed package; /sgl-workspace/sgl-nvidia-mega is the megakernel plugin's. /opt/sglang links to the Chainguard tree under /opt/chainguard/sglang.
  • Command. The container runs its arguments, or bash when there are none.
  • Environment. VIRTUAL_ENV, CUDA_HOME, LD_LIBRARY_PATH, LIBRARY_PATH, SGLANG_RUST_BUILD_MODE, UV_LINK_MODE, the locale, NVIDIA_VISIBLE_DEVICES, NVIDIA_DRIVER_CAPABILITIES, NVIDIA_REQUIRE_CUDA and NVIDIA_PRODUCT_NAME match upstream.
  • Tools. uv, git, wget, curl, nc, GnuPG, the OpenSSL headers, ninja, and the RDMA and InfiniBand utilities are installed, and /opt/nvidia/nvidia_entrypoint.sh links to the entrypoint.
  • Architectures. x86_64 and aarch64. On aarch64 Hopper GPUs such as GH200, pass --attention-backend flashinfer: SGLang defaults Hopper to FA3, whose kernel the aarch64 sglang-kernel wheel does not include, in this image or upstream's.

The image differs from upstream in the following ways. Each difference is deliberate:

  • It runs as the nonroot user (UID 65532), not root. Its home is /home/nonroot, so the Hugging Face cache is /home/nonroot/.cache/huggingface: mount volumes there instead of under /root. A host directory mounted there must be writable by UID 65532. Upstream's FA3 kernels.lock is linked into /home/nonroot/.cache/sglang. /opt/sglang and /sgl-workspace are owned by root, so images that pip install into the venv need USER root for that step.
  • The entrypoint requires a driver. It checks that the NVIDIA driver loads, and does not enable CUDA forward compatibility: on a driver older than R580, set LD_LIBRARY_PATH=/usr/local/cuda/compat:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64. Upstream's only warns when no driver is found; without a GPU and the NVIDIA Container Toolkit, this one stops with FATAL: libcuda.so.1 not found in the library path. To run without a GPU, override it with --entrypoint /bin/bash.
  • Some upstream variables are not set. CUDA_VERSION, NCCL_VERSION and the NV_* apt package pins come from NVIDIA's Ubuntu base image. UV_PYTHON_INSTALL_DIR and UV_PYTHON_PREFERENCE point at a uv-managed Python under /opt/python; this image's venv uses the system Python. GDRCOPY_HOME names the gdrdrv kernel-module source, which is not included. SGLANG_BUILD_COMMIT, SGLANG_BUILD_URL and SGLANG_IMAGE_TAG describe upstream's CI build.
  • FlashInfer kernels compile on first use. Upstream installs prebuilt kernels (flashinfer-jit-cache). This image builds each kernel the first time a model needs it, which slows the first startup, and caches it under /home/nonroot/.cache/sglang with the Triton, Inductor and CUDA caches. Mount a volume there to keep compiled kernels across restarts. A host directory mounted there must be writable by UID 65532.
  • AI Dynamo is not installed. Upstream adds the newest ai-dynamo nightly from NVIDIA's index, which SGLang does not import; Dynamo's own SGLang images install their Dynamo build on top of upstream's. In upstream's image it is broken: ai-dynamo-runtime caps pydantic below the release it ships beside, and its google-vizier dependency holds typeguard below what inflect requires.
  • NIXL is built from source without NVIDIA-proprietary parts. Its UCX, POSIX, GDS and libfabric backends are included, on a source-built UCX with the mlx5 and GDA transports. Upstream's NIXL wheels bundle UCX modules under an NVIDIA-proprietary license, and S3, Azure Blob and etcd support built against OpenSSL 3; this image omits both.
  • Video I/O uses the system FFmpeg. PyAV and imageio-ffmpeg use it instead of the FFmpeg copies bundled in their wheels, and OpenCV is a newer release than upstream pins, since every OpenCV wheel bundles OpenSSL and FFmpeg.
  • perftest is not installed. Upstream's image includes linux-rdma's ib_*_bw and ib_*_lat benchmarks, which SGLang does not use; rdma-core's ibv_devinfo and ibstat and UCX's ucx_perftest are available for fabric checks.

Prerequisites

  • An NVIDIA GPU and a driver that supports CUDA 13.0 (R580 or later). On data center GPUs with an older driver, put /usr/local/cuda/compat first on LD_LIBRARY_PATH for CUDA forward compatibility.
  • The NVIDIA Container Toolkit on the host, or the NVIDIA GPU Operator on Kubernetes.

Getting Started

Serve a model with the OpenAI-compatible API on port 30000:

docker run --rm \
  --gpus all \
  --shm-size 32g \
  --ipc=host \
  -p 30000:30000 \
  -e HF_TOKEN \
  -v sglang-hf-cache:/home/nonroot/.cache/huggingface \
  cgr.dev/ORGANIZATION/sglang:latest \
  python3 -m sglang.launch_server \
    --model-path Qwen/Qwen2.5-7B-Instruct \
    --host 0.0.0.0 \
    --port 30000

Once the server reports it is ready, check its health and send a request:

curl -f http://localhost:30000/health
curl http://localhost:30000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model": "Qwen/Qwen2.5-7B-Instruct", "messages": [{"role": "user", "content": "Hello"}]}'

Documentation and Resources

What are Chainguard Containers?

Chainguard's free tier of Starter container images are built with Wolfi, our minimal Linux undistro.

All other Chainguard Containers are built with Chainguard OS, Chainguard's minimal Linux operating system designed to produce container images that meet the requirements of a more secure software supply chain.

The main features of Chainguard Containers include:

For cases where you need container images with shells and package managers to build or debug, most Chainguard Containers come paired with a development, or -dev, variant.

In all other cases, including Chainguard Containers tagged as :latest or with a specific version number, the container images include only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager.

Although the -dev container image variants have similar security features as their more minimal versions, they include additional software that is typically not necessary in production environments. We recommend using multi-stage builds to copy artifacts from the -dev variant into a more minimal production image.

Need additional packages?

To improve security, Chainguard Containers include only essential dependencies. Need more packages? Chainguard customers can use Custom Assembly to add packages, either through the Console, chainctl, or API.

To use Custom Assembly in the Chainguard Console: navigate to the image you'd like to customize in your Organization's list of images, and click on the Customize image button at the top of the page.

Learn More

Refer to our Chainguard Containers documentation on Chainguard Academy. Chainguard also offers VMs and Libraries — contact us for access.

Trademarks

This software listing is packaged by Chainguard. The trademarks set forth in this offering are owned by their respective companies, and use of them does not imply any affiliation, sponsorship, or endorsement by such companies.

Licenses

Chainguard's container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:

  • BSD-3-Clause-Open-MPI

  • LGPL-3.0

  • LicenseRef-NVIDIA-CUDA-nvshmem

  • LicenseRef-NVIDIA-NVPTXCompiler-13.0

  • PROPRIETARY

For a complete list of licenses, please refer to this Image's SBOM.

Software license agreement

Compliance

Chainguard Containers are SLSA Level 3 compliant with detailed metadata and documentation about how it was built. We generate build provenance and a Software Bill of Materials (SBOM) for each release, with complete visibility into the software supply chain.

SLSA compliance at Chainguard

This image helps reduce time and effort in establishing PCI DSS 4.0 compliance with low-to-no CVEs.

PCI DSS at Chainguard

Category
AI

The trusted source for open source

Talk to an expert
PrivacyTerms

Product

Chainguard ContainersChainguard LibrariesChainguard VMsChainguard OS PackagesChainguard ActionsChainguard Agent SkillsIntegrationsPricing
© 2026 Chainguard, Inc. All Rights Reserved.
Chainguard® and the Chainguard logo are registered trademarks of Chainguard, Inc. in the United States and/or other countries.
The other respective trademarks mentioned on this page are owned by the respective companies and use of them does not imply any affiliation or endorsement.