From 60fd98a5e420ba8aa460d13419271ced1585a5c2 Mon Sep 17 00:00:00 2001 From: Di-Is Date: Wed, 3 Jul 2024 20:51:55 +0900 Subject: [PATCH] Include uvx binary to docker image. (#4764) Fix #4763 ## Summary Modify the Dockerfile to include the uvx binary in the docker image `ghcr.io/astral-sh/uv`. ## Test Plan I have verified that the uvx binary is included in the Docker image built with the following command and can be executed. ```bash # cd repository root docker build -t uv:add_uvx . docker run --rm --entrypoint /uvx uv -V uv-tool-run 0.2.21 ``` --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b00ead2f4..f5b70045f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,12 +34,14 @@ RUN rustup target add $(cat rust_target.txt) COPY crates crates COPY ./Cargo.toml Cargo.toml COPY ./Cargo.lock Cargo.lock -RUN cargo zigbuild --bin uv --target $(cat rust_target.txt) --release -RUN cp target/$(cat rust_target.txt)/release/uv /uv +RUN cargo zigbuild --bin uv --bin uvx --target $(cat rust_target.txt) --release +RUN cp target/$(cat rust_target.txt)/release/uv /uv \ + && cp target/$(cat rust_target.txt)/release/uvx /uvx # TODO(konsti): Optimize binary size, with a version that also works when cross compiling # RUN strip --strip-all /uv FROM scratch COPY --from=build /uv /uv +COPY --from=build /uvx /uvx WORKDIR /io ENTRYPOINT ["/uv"]