Skip to content

Commit 76dcd97

Browse files
authored
Retrieve a binary release of cargo-local-registry (#38)
* Retrieve a binary release of cargo-local-registry * Extract dependencies versions to variables
1 parent 59acc0d commit 76dcd97

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

Dockerfile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# always build this using the latest stable release
22
FROM rust:latest as build
33

4+
ARG CLR_NAME=cargo-local-registry
5+
ARG CLR_VERSION=0.2.2
6+
ARG CLR_URL=https://github.com/dhovart/${CLR_NAME}/releases/download/${CLR_VERSION}/${CLR_NAME}-${CLR_VERSION}-x86_64-unknown-linux-musl.tar.gz
7+
8+
ARG JQ_VERSION=1.6
9+
ARG JQ_URL=https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64
10+
411
RUN mkdir -p /rust-test-runner/src
512
ENV wd /rust-test-runner
613
WORKDIR ${wd}
@@ -17,10 +24,13 @@ COPY src/* src/
1724
RUN cargo build --release
1825
COPY bin/generate-registry.sh ${wd}/bin/
1926
# download jq
20-
RUN curl -L -o /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 \
21-
&& chmod +x /usr/local/bin/jq
22-
# build cargo-local-registry
23-
RUN cargo install --git https://github.com/ChrisGreenaway/cargo-local-registry.git
27+
RUN curl -L -o /usr/local/bin/jq "${JQ_URL}" \
28+
&& chmod +x /usr/local/bin/jq
29+
# retrieve cargo-local-registry
30+
RUN curl -L -o clr.tar.gz "${CLR_URL}" \
31+
&& tar xvzf clr.tar.gz --strip-components=1 \
32+
&& chmod +x cargo-local-registry \
33+
&& mv cargo-local-registry /usr/local/cargo/bin
2434
# download popular crates to local registry
2535
WORKDIR /local-registry
2636
COPY local-registry/* ./

0 commit comments

Comments
 (0)