-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile.trustee-client
More file actions
47 lines (36 loc) · 1.64 KB
/
Dockerfile.trustee-client
File metadata and controls
47 lines (36 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Copyright (c) 2024 by Alibaba.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
FROM alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:latest as builder
ARG ALL_PROXY
ARG NO_PROXY
ENV ALL_PROXY=$ALL_PROXY
ENV NO_PROXY=$NO_PROXY
ARG CARGO_JOBS
RUN yum install -y perl wget curl clang openssh-clients openssl-devel protobuf-devel git
WORKDIR /usr/src/trustee
COPY . .
# Install Rust
RUN export RUSTUP_DIST_SERVER='https://mirrors.ustc.edu.cn/rust-static' && \
export RUSTUP_UPDATE_ROOT='https://mirrors.ustc.edu.cn/rust-static/rustup' && \
curl --proto '=https' --tlsv1.2 -sSf https://mirrors.aliyun.com/repo/rust/rustup-init.sh | \
sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN export RUSTUP_DIST_SERVER='https://mirrors.ustc.edu.cn/rust-static' && \
export RUSTUP_UPDATE_ROOT='https://mirrors.ustc.edu.cn/rust-static/rustup' && \
rustup toolchain install 1.79.0-x86_64-unknown-linux-gnu
RUN printf '\
[source.crates-io]\n\
replace-with = "aliyun"\n\
[source.aliyun]\n\
registry = "sparse+https://mirrors.aliyun.com/crates.io-index/"\n\
' > ~/.cargo/config
RUN if [ -n "$CARGO_JOBS" ]; then \
[ ! -d /root/.cargo ] && mkdir /root/.cargo; \
echo -e "[build]\njobs = $CARGO_JOBS" >> /root/.cargo/config.toml; \
fi
RUN cargo build -p kbs-client --locked --release --no-default-features --features sample_only
FROM alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:latest
WORKDIR /tmp
# Copy binaries
COPY --from=builder /usr/src/trustee/target/release/kbs-client /usr/local/bin/trustee-client