Docker Build
DevOps & Securitydocker-buildDocker Build is an Agent Skill for devops & security published in the InternLM/lmdeploy repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Build an LMDeploy Docker image and push it to the inner registry.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/InternLM/lmdeploy/blob/HEAD/.claude/skills/docker-build/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/docker-build, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Docker Build & Push
Build an LMDeploy Docker image and push it to the inner registry.
Prerequisites
Before starting, verify all three environment variables are set:
echo $LMDEPLOY_REGISTRY # inner registry server address
echo $REGISTRY_USER # registry login username
test -n "$REGISTRY_PASSWORD" && echo "<set>" || echo "<missing>" # registry login password
If any are missing, stop and tell the user to set them before proceeding.
1. Determine image tag
BRANCH=$(git branch --show-current | sed 's/[^a-zA-Z0-9._-]/-/g')
SHA=$(git rev-parse --short=7 HEAD)
TAG="${BRANCH}-${SHA}"
IMAGE="${LMDEPLOY_REGISTRY}/ailab-puyu-puyu_gpu/lmdeploy-dev:${TAG}"
Print the computed image name so the user can confirm.
2. Build
Ask the user which build mode:
- patch (default) — uses
docker/Dockerfile_patch, fast overlay on existing image - full — uses
docker/Dockerfile, full multi-stage build from scratch
Patch build (default)
docker build -f docker/Dockerfile_patch \
--build-arg BASE_IMAGE=openmmlab/lmdeploy:v0.12.3.post2-cu12.8 \
--build-arg BACKEND=pytorch \
--build-arg http_proxy=${http_proxy:-} \
--build-arg https_proxy=${https_proxy:-} \
--build-arg no_proxy=${no_proxy:-} \
-t "${IMAGE}" \
.
User can override:
BASE_IMAGE— defaultopenmmlab/lmdeploy:v0.12.3.post2-cu12.8BACKEND— defaultpytorch; set toturbomindto include TurboMind C++ extension
Full build
docker build -f docker/Dockerfile \
--build-arg CUDA_VERSION=cu12.8 \
--build-arg http_proxy=${http_proxy:-} \
--build-arg https_proxy=${https_proxy:-} \
--build-arg no_proxy=${no_proxy:-} \
-t "${IMAGE}" \
.
User can override CUDA_VERSION — default cu12.8.
Verify
docker images "${IMAGE}"
3. Push
Skip this step if the user only wants a local build.
Login
echo "${REGISTRY_PASSWORD}" | docker login "${LMDEPLOY_REGISTRY}" -u "${REGISTRY_USER}" --password-stdin
Push
docker push "${IMAGE}"
Confirm success via exit code.