Skip to content

CICD-445 · GPU-enabled Docker image building ​

Encyclopedia · GPU and inference infrastructure · All snippets

Previous · CICD-444 · Next · CICD-446

1. Where it fits ​

  • Placement Dockerfile.gpu.
  • Prerequisites dedicated GPU lab, approved images and model revision, fixed benchmark profile.
  • Platforms local-lab.
  • Parameters BASE_IMAGE.

2. Copy the snippet ​

dockerfile
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
WORKDIR /app
COPY requirements.txt .
RUN python -m pip install --no-cache-dir --require-hashes -r requirements.txt
COPY server.py .
ENTRYPOINT ["python", "server.py"]

3. How it works ​

Build instructions are processed in order. ARG applies before FROM only when declared at that scope.

4. Verify the result ​

Supply a verified Python-capable CUDA base digest and hashed dependencies. Run GPU checks after build.

Validation untested. Status definitions.