Michael Rabinovich Cursor commited on
Commit ·
818fd28
1
Parent(s): aa263ac
Dockerfile: use x-access-token:TOKEN URL form for classic PAT
Browse filesPrevious URL form 'https://$TOKEN@github.com/...' relied on GitHub's
special-case where fine-grained PATs are accepted as a single-value
username. Classic PATs don't get that special-casing: git parses
'TOKEN@github.com' as username=TOKEN with no password and then prompts
for one, which fails in the non-interactive Docker build with
'No such device or address'.
Switching to 'https://x-access-token:$TOKEN@github.com/...' (GitHub
Actions convention) is the standard explicit-Basic-Auth form and works
uniformly for classic + fine-grained PATs, so the URL stays the same
when we eventually swap GH_PAT for a deploy key (the URL changes to
ssh+git anyway in that case).
Co-authored-by: Cursor <cursoragent@cursor.com>
- Dockerfile +7 -1
Dockerfile
CHANGED
|
@@ -60,9 +60,15 @@ RUN pip install --no-cache-dir playwright \
|
|
| 60 |
# not exposed as env, not written to disk after the layer commits. Bumping
|
| 61 |
# CADGENBENCH_SHA is the one-line path to picking up a new cadgenbench.
|
| 62 |
ARG CADGENBENCH_SHA=d7e0468
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
RUN --mount=type=secret,id=GH_PAT,mode=0400,required=true \
|
| 64 |
pip install --no-cache-dir \
|
| 65 |
-
"cadgenbench @ git+https://$(cat /run/secrets/GH_PAT)@github.com/huggingface/cadgenbench.git@${CADGENBENCH_SHA}"
|
| 66 |
|
| 67 |
# Drop privileges. HF Spaces conventionally run as uid 1000 with
|
| 68 |
# WORKDIR /home/user/app.
|
|
|
|
| 60 |
# not exposed as env, not written to disk after the layer commits. Bumping
|
| 61 |
# CADGENBENCH_SHA is the one-line path to picking up a new cadgenbench.
|
| 62 |
ARG CADGENBENCH_SHA=d7e0468
|
| 63 |
+
# URL form `https://x-access-token:<token>@github.com/...` (GitHub Actions
|
| 64 |
+
# convention) rather than the bare `https://<token>@github.com/...` form:
|
| 65 |
+
# the bare form works only for fine-grained PATs (GitHub special-cases the
|
| 66 |
+
# single-value username), while classic PATs need explicit
|
| 67 |
+
# `username:token` Basic Auth or git prompts for a password and fails in
|
| 68 |
+
# the non-interactive container build.
|
| 69 |
RUN --mount=type=secret,id=GH_PAT,mode=0400,required=true \
|
| 70 |
pip install --no-cache-dir \
|
| 71 |
+
"cadgenbench @ git+https://x-access-token:$(cat /run/secrets/GH_PAT)@github.com/huggingface/cadgenbench.git@${CADGENBENCH_SHA}"
|
| 72 |
|
| 73 |
# Drop privileges. HF Spaces conventionally run as uid 1000 with
|
| 74 |
# WORKDIR /home/user/app.
|