-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Official docker image #5072
Comments
Not official but you could use GitLab's implementation of the container |
That looks like a decent option to start with, but it is using it's own versioning system and the advantage of an official |
I know it's not really what you've been asking for, but would docker run --rm --entrypoint bash -v $(pwd):/io python:3.11 -c "python -m pip install ruff==0.0.274 && ruff /io" work for you? It has the version number and takes about 3.5s on my machine. I've been looking for an image with pipx which would be nicer but couldn't find a well maintained one. |
That's definitely possible, but then that has to be downloaded and installed each time. Hoping for something simpler for CI |
What CI system are you using and how does a docker image (vs., let's say |
We're using GitHub Actions, so I could use the available action for that, but I prefer using a container to run the process because then we can be sure that what's run on the developers machine is the exact same process. Maybe that's overly paranoid on my part, but my quick poking around didn't show an easy way to run |
Here's Alpine:
Debian:
|
Are there clear trade-offs to pulling the builds from GitHub vs including a build image step? I think using a
There's, of course, some complexity added there. It'd also be nice to use distroless? Multi-arch support added in GoogleContainerTools/distroless#591 |
I think that would be great! I just couldn't find any info on how to build
In my experience, |
Huh interesting, they say otherwise?
|
Oh interesting, I presumed this issue was requesting an |
I was looking at the I tried running the currently built images with
I'm fine with it being wherever, but if it's not an official image, then rate limits will apply and for a tool like this, I think that would be a problem |
Ah that's complicated since we build Python wheels using Maturin:
@konstin definitely knows more about this than me. |
Ideally, |
We can put the statically linked binary in a scratch image: #8554 FROM rust:1.73 as build
RUN apt update && apt install musl musl-dev musl-tools
RUN rustup target add x86_64-unknown-linux-musl
COPY crates crates
COPY Cargo.toml Cargo.toml
COPY Cargo.lock Cargo.lock
RUN cargo build --bin ruff --release --target x86_64-unknown-linux-musl
# Optimize binary size
RUN strip --strip-all target/x86_64-unknown-linux-musl/release/ruff
FROM scratch
COPY --from=build target/x86_64-unknown-linux-musl/release/ruff /ruff
WORKDIR /io
ENTRYPOINT ["/ruff"] $ docker run -v .:/io --rm ruff check --select G004 .
scripts/check_ecosystem.py:51:26: G004 Logging statement uses f-string
scripts/check_ecosystem.py:55:22: G004 Logging statement uses f-string
scripts/check_ecosystem.py:84:13: G004 Logging statement uses f-string
scripts/check_ecosystem.py:177:18: G004 Logging statement uses f-string
scripts/check_ecosystem.py:200:18: G004 Logging statement uses f-string
scripts/check_ecosystem.py:354:18: G004 Logging statement uses f-string
scripts/check_ecosystem.py:477:18: G004 Logging statement uses f-string
Found 7 errors. $ docker image ls ruff
REPOSITORY TAG IMAGE ID CREATED SIZE
ruff latest 505876b0f817 2 minutes ago 16.2MB I've never worked with docker multi arch, so i'd be happy if someone wants to port the dockerfile. |
The docker image is available at https://ghcr.io/astral-sh/ruff |
Could an official docker image be created for
ruff
, so it's easier to run in CI environments?The text was updated successfully, but these errors were encountered: