-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (35 loc) · 1.85 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (35 loc) · 1.85 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
48
49
50
51
FROM bitnami/pytorch:1.13.1-debian-11-r33 AS builder
USER root
RUN apt-get update \
&& apt-get install curl build-essential ca-certificates tzdata net-tools pkg-config libssl-dev openssl -y \
&& curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path --default-toolchain none -y \
&& $HOME/.cargo/bin/rustup default stable \
&& $HOME/.cargo/bin/rustc --version
ENV PATH $HOME/.cargo/bin:$PATH
COPY . .
ENV LIBTORCH=/opt/bitnami/python/lib/python3.8/site-packages/torch
ENV DYLD_LIBRARY_PATH=${LIBTORCH}/lib
ENV LD_LIBRARY_PATH=${LIBTORCH}/lib:$LD_LIBRARY_PATH
#RUN rustup target add x86_64-unknown-linux-musl
#--target=x86_64-unknown-linux-musl
RUN rustup target add x86_64-unknown-linux-gnu
RUN cargo build --release --bin algo-rust-bert-demo
RUN cp target/release/algo-rust-bert-demo /app/algo-rust-bert-demo
FROM bitnami/pytorch:1.13.1-debian-11-r33
USER root
ENV GRPC_HEALTH_PROBE_VERSION=v0.4.17
RUN apt-get update \
&& apt-get install curl wget build-essential ca-certificates tzdata net-tools pkg-config libssl-dev openssl -y \
&& wget -qO /bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 \
&& chmod +x /bin/grpc_health_probe \
&& wget -qO /bin/grpcurl_1.8.7_linux_x86_64.tar.gz https://github.com/fullstorydev/grpcurl/releases/download/v1.8.7/grpcurl_1.8.7_linux_x86_64.tar.gz \
&& tar -xf /bin/grpcurl_1.8.7_linux_x86_64.tar.gz -C /bin \
&& rm -rf /bin/grpcurl_1.8.7_linux_x86_64.tar.gz \
&& rm -rf /var/lib/apt/lists/*
ENV LIBTORCH=/opt/bitnami/python/lib/python3.8/site-packages/torch
ENV DYLD_LIBRARY_PATH=${LIBTORCH}/lib
ENV LD_LIBRARY_PATH=${LIBTORCH}/lib:$LD_LIBRARY_PATH
COPY --from=builder /app/algo-rust-bert-demo algo-rust-bert-demo
RUN mkdir resources
COPY ./resources ./resources
CMD ["./algo-rust-bert-demo"]