ChatQnA Build
Build Chat Question and Answer Core container images directly with Docker and Docker Compose.
Environment setup (run first)
This skill operates on real ChatQnA source files, so the ChatQnA application must be present and commands must run from the app root. Do this before any build flow, whether or not source is already in your workspace.
Run the bundled bootstrap. It searches for an existing ChatQnA checkout by
walking up from the current directory and checking the enclosing git repo, then
reuses it without re-cloning. Only when no checkout is found does it do a
shallow, single-branch, sparse checkout of just
sample-applications/chat-question-and-answer-core from main.
It prints the resolved app root on stdout:
# SKILL_DIR is this skill directory. In-repo it is:
# .github/skills/chatqna-build
SKILL_DIR=".github/skills/chatqna-build"
APP_ROOT="$(bash "$SKILL_DIR/scripts/chatqna-bootstrap.sh")"
cd "$APP_ROOT"
Every command below assumes the working directory is this APP_ROOT.
To use a fork/branch or a specific clone path, override these before running the bootstrap script:
CHATQNA_REPO_URLCHATQNA_REPO_BRANCHCHATQNA_CLONE_DIRCHATQNA_FORCE_CLONE(set to1to force clone)
Codebase root: sample-applications/chat-question-and-answer-core/
Build Sources of Truth
| File | Purpose |
|---|---|
docker/Dockerfile |
OpenVINO backend image (CPU by default; GPU via USE_GPU=true) |
docker/Dockerfile.ollama |
Ollama backend image |
ui/Dockerfile |
Frontend UI image |
docker/compose.yaml |
Canonical image names, build contexts, and build args |
When to Use
- Build backend and UI images from source
- Rebuild one runtime variant (OpenVINO CPU, OpenVINO GPU, or Ollama)
- Build images with explicit tags before local deploy/publish
Build Controls
Set tags and optional registry prefix in shell before building:
| Var | Effect | Default |
|---|---|---|
BACKEND_TAG |
tag for backend image ${REGISTRY}chatqna:${BACKEND_TAG} |
latest |
UI_TAG |
tag for UI image ${REGISTRY}chatqna-ui:${UI_TAG} |
latest |
REGISTRY |
image prefix (for example intel/) |
empty |
http_proxy / https_proxy / no_proxy |
forwarded into builds | inherited |
Final image names match compose:
- Backend OpenVINO/Ollama:
${REGISTRY}chatqna:${BACKEND_TAG} - UI:
${REGISTRY}chatqna-ui:${UI_TAG}
Typical Build Flows
# 0) From sample root
cd sample-applications/chat-question-and-answer-core
# 1) Optional tags/prefix
export REGISTRY=""
export BACKEND_TAG="latest"
export UI_TAG="latest"
# 2) Build OpenVINO CPU backend image
docker build -t ${REGISTRY}chatqna:${BACKEND_TAG} -f docker/Dockerfile .
# 3) Build OpenVINO GPU backend image (same image name/tag, GPU variant)
docker build --build-arg USE_GPU=true -t ${REGISTRY}chatqna:${BACKEND_TAG} -f docker/Dockerfile .
# 4) Build Ollama backend image
docker build -t ${REGISTRY}chatqna:${BACKEND_TAG} -f docker/Dockerfile.ollama .
# 5) Build UI image
docker build -t ${REGISTRY}chatqna-ui:${UI_TAG} -f ui/Dockerfile ui/
Compose-driven alternative (build only, no start):
# Build only active profile services
source scripts/setup_env.sh # or: -d gpu / -b ollama
docker compose -f docker/compose.yaml build
Prerequisites and Gotchas
- Docker engine and Docker Compose plugin must be available.
- OpenVINO GPU builds require hosts and runtimes that support
/dev/drifor later runtime. source scripts/setup_env.shis recommended before compose builds so profile/env values are aligned.- If reusing the same
${BACKEND_TAG}across variants, the latest build will overwrite that local tag.
Verify
docker images | grep -E 'chatqna|chatqna-ui'
docker compose -f docker/compose.yaml config --services
Completion Criteria
- Requested runtime/backend images are built successfully.
- Resulting local image tags match requested
REGISTRYand tags. - Build output and next action (deploy or push) are clearly reported.