Optimize client Docker image: use runtime base and clean up#263
Open
Optimize client Docker image: use runtime base and clean up#263
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduce client Docker image download size by 2.78 GB (51%) by switching from the CUDA
develbase image toruntime, removing duplicate apt packages, and removing a redundantuv syncstep.Changes
Changed
nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04tonvidia/cuda:12.8.1-cudnn-runtime-ubuntu22.04in bothDockerfileandDockerfile.dev— thedevelvariant includes the full CUDA compiler toolchain (~3GB) which is not needed for running pre-compiled GPU workloadsuv syncafteruv addin productionDockerfile—uv addalready performs a syncFixed
libfontconfig1,libdbus-1-3,libxkbcommon-x11-0(already installed later in the sameRUNcommand via the X11 library block)Measured Impact
Base Image Size (compressed, linux/amd64)
cudnn-devel(before)cudnn-runtime(after)The savings come from removing the CUDA dev toolchain layer (2.99 GB): nvcc, cuda-command-line-tools, cuda-libraries-dev, static libraries, and profiling tools.
CI Pull Time (GitHub Actions)
Allocator image (unchanged control) showed no timing difference (10-13s), confirming improvements are real.
Technical Details
The
develCUDA image variant includesnvcc, CUDA headers, and static libraries needed for compiling CUDA code. Theruntimevariant includes only the shared libraries needed to run CUDA applications. Since the client container runs pre-built Python packages (PyTorch wheels, etc.) rather than compiling CUDA kernels,runtimeis sufficient.The duplicate apt packages were harmless (apt handles duplicates gracefully) but added confusion when reviewing the package list.
Testing
subscribe,check_gpu,update_inuse_status)nvidia-smi, PyTorch GPU detection)🤖 Generated with Claude Code