Skip to content

Commit 52193b7

Browse files
committed
feat: fix precommit container erro
Signed-off-by: yuluo-yx <[email protected]>
1 parent 0a3af6e commit 52193b7

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

Dockerfile.precommit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ RUN apt-get update && apt-get install -y \
66
build-essential \
77
pkg-config \
88
python3 \
9+
libssl-dev \
10+
ca-certificates && \
911
python3-pip
1012

1113
# Install Node.js and npm

tools/make/pre-commit.mk

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
PRECOMMIT_CONTAINER := ghcr.io/vllm-project/semantic-router/precommit:latest
2+
13
precommit-install:
24
pip install pre-commit
35

@@ -19,6 +21,18 @@ precommit-check:
1921
echo "No Go, Rust, JavaScript, Markdown, Yaml, or Python files found to check"; \
2022
fi
2123

24+
# Run pre-commit hooks in a Docker container
25+
# and you can exec container to run bash for debug.
26+
# docker run --rm -it \
27+
# -v $(shell pwd):/app \
28+
# --name precommit-container ${PRECOMMIT_CONTAINER} \
29+
# cd /app &&
30+
# bash
2231
precommit-local:
23-
docker pull ghcr.io/vllm/semantic-router/precommit:latest
24-
docker run --rm -v $$(pwd):/data ghcr.io/vllm-project/semantic-router/precommit:latest pre-commit run --all-files
32+
docker pull ${PRECOMMIT_CONTAINER}
33+
docker run --rm \
34+
-v $(pwd):/app \
35+
--name precommit-container ${PRECOMMIT_CONTAINER}
36+
cd /app && \
37+
pre-commit install && \
38+
pre-commit run --all-files

0 commit comments

Comments
 (0)