ruff/scripts/Dockerfile.ecosystem
konstin 19d8913e32
Use musl in ecosystem docker (#3998)
This prevents errors when the host glibc is newer than the one in the docker container
2023-04-26 05:54:53 +02:00

27 lines
1.2 KiB
Text

# [crater](https://github.com/rust-lang/crater)-inspired check that tests against a large number of
# projects, mainly from https://github.com/akx/ruff-usage-aggregate.
#
# We run this in a Docker container as Ruff isn't designed for untrusted inputs.
#
# Either download https://github.com/akx/ruff-usage-aggregate/blob/master/data/known-github-tomls.jsonl as
# `github_search.jsonl` or follow the instructions in the README to scrape your own dataset.
#
# Setup:
# ```
# apt-get install musl-tools # or corresponding command to install musl on your platform, e.g. `yay musl`
# rustup target add x86_64-unknown-linux-musl
# ```
# From the project root:
# ```
# cargo build --target x86_64-unknown-linux-musl
# docker buildx build -f scripts/Dockerfile.ecosystem -t ruff-ecosystem-checker --load .
# docker run --rm ruff-ecosystem-checker
# ```
FROM python:3.11
RUN python -m venv .venv && .venv/bin/pip install ruff
ADD scripts/check_ecosystem.py check_ecosystem.py
ADD github_search.jsonl github_search.jsonl
ADD target/x86_64-unknown-linux-musl/debug/ruff ruff-new
CMD ["python", "check_ecosystem.py", "--verbose", "--projects", "github_search.jsonl", "ruff-new", ".venv/bin/ruff"]