Skip to content

Commit 8a04271

Browse files
fix(docker): ship git so the image can scaffold templates (#220)
The slim image only exposed --version/--help; scaffolding needs git to clone cpa-templates. Install git+ca-certificates and add a Docker scaffold smoke to catch regressions (#219). Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 261fc54 commit 8a04271

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/smoke-distribution.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,25 @@ jobs:
6565
test -s /tmp/cpa-help.txt
6666
python3 -c "from pathlib import Path; print('\n'.join(Path('/tmp/cpa-help.txt').read_text().splitlines()[:5]))"
6767
68+
# Image must ship git so template/extension clones work (see #219).
69+
- name: Verify scaffold smoke
70+
run: |
71+
set -euo pipefail
72+
mkdir -p /tmp/cpa-docker-smoke
73+
docker run --rm \
74+
-e CI=true \
75+
-v /tmp/cpa-docker-smoke:/out \
76+
-w /out \
77+
"$DOCKER_IMAGE:latest" \
78+
--template fastapi-starter \
79+
--addons github-setup \
80+
--no-interactive \
81+
--no-install \
82+
--refresh always \
83+
/out/app
84+
test -d /tmp/cpa-docker-smoke/app/.github/workflows
85+
test -d /tmp/cpa-docker-smoke/app/app
86+
6887
homebrew:
6988
name: Homebrew (Create-Python-App/tap)
7089
runs-on: macos-latest

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ FROM python:3.12-slim-bookworm
66
# reproducible for its tag).
77
ARG VERSION=latest
88

9+
# git is required to clone cpa-templates (see #219).
10+
# hadolint ignore=DL3008
11+
RUN apt-get update \
12+
&& apt-get install -y --no-install-recommends git ca-certificates \
13+
&& rm -rf /var/lib/apt/lists/*
14+
915
# Retry pip install: PyPI simple-index / CDN edges can lag the JSON API
1016
# that CI already observed as ready (see #217).
1117
# hadolint ignore=DL3013

0 commit comments

Comments
 (0)