-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ouyangkang
committed
Mar 13, 2024
1 parent
41dee90
commit 6a461ef
Showing
2 changed files
with
52 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,107 +1,35 @@ | ||
# FROM rust:1.74-slim as builder | ||
|
||
# WORKDIR /usr/src/ | ||
|
||
# COPY . . | ||
|
||
# RUN apt-get update && apt-get install -y libssl-dev pkg-config | ||
|
||
# RUN cargo build --release | ||
|
||
# FROM debian:bookworm-slim | ||
|
||
# RUN apt-get update && apt-get install -y libc6 | ||
|
||
# WORKDIR /usr/app | ||
|
||
# COPY --from=builder /usr/src/config /usr/app/config | ||
# COPY --from=builder /usr/src/target/release/credits-cli /usr/app/credits-cli | ||
|
||
|
||
FROM rust:1.74-slim as builder | ||
|
||
RUN rustup target add x86_64-unknown-linux-musl | ||
RUN apt update && apt install -y musl-tools musl-dev | ||
|
||
WORKDIR /usr/src/ | ||
|
||
COPY . . | ||
|
||
# # RUN sed -i "s@http://deb.debian.org@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list | ||
# # RUN cat /etc/apt/sources.list | ||
# # RUN rm -Rf /var/lib/apt/lists/* | ||
# # RUN apt-get update | ||
|
||
COPY dockerfileconfig/sources.list /etc/apt/sources.list | ||
|
||
# RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main" > /etc/apt/sources.list \ | ||
# && echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main" >> /etc/apt/sources.list \ | ||
# && apt-get update \ | ||
# && apt-get clean | ||
RUN cat /etc/apt/sources.list | ||
RUN rm -Rf /var/lib/apt/lists/* | ||
RUN apt-get update | ||
|
||
# # COPY dockerfileconfig/sources.list /etc/apt/sources.list | ||
RUN apt-get install -y libssl-dev pkg-config | ||
|
||
# # RUN cat /etc/apt/sources.list | ||
# # RUN rm -Rf /var/lib/apt/lists/* | ||
# # RUN apt-get update | ||
COPY dockerfileconfig/config /root/.cargo/config | ||
|
||
# RUN apt-get install -y libssl-dev pkg-config | ||
RUN cat /root/.cargo/config | ||
|
||
# COPY dockerfileconfig/config /root/.cargo/config | ||
RUN cargo build --release | ||
|
||
RUN cargo build --target x86_64-unknown-linux-musl --release | ||
FROM debian:bookworm-slim | ||
|
||
FROM alpine | ||
|
||
COPY --from=builder /etc/apt/sources.list /etc/apt/sources.list | ||
|
||
# RUN sed -i "s@http://deb.debian.org@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list | ||
# # COPY --from=builder /usr/src/dockerfileconfig/sources.list /etc/apt/sources.list | ||
# RUN cat /etc/apt/sources.list | ||
# RUN rm -Rf /var/lib/apt/lists/* | ||
# RUN apt-get update | ||
# # RUN sed -i "s@http://deb.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list && rm -Rf /var/lib/apt/lists/* && apt-get update | ||
|
||
# RUN apt-get install -y libc6 | ||
RUN cat /etc/apt/sources.list | ||
RUN rm -Rf /var/lib/apt/lists/* | ||
RUN apt-get update | ||
RUN apt-get install -y libc6 | ||
|
||
WORKDIR /usr/app | ||
|
||
COPY --from=builder /usr/src/config /usr/app/config | ||
COPY --from=builder /usr/src/target/release/credits-cli /usr/app/credits-cli | ||
|
||
|
||
|
||
# # # ENV start_params=" " | ||
|
||
|
||
# # # FROM dockerhub.tezign.com/innovation/muse-credits/muse-credits:v1.6 | ||
|
||
# # # ENV start_params=" " | ||
|
||
# # # EXPOSE 8080 | ||
# # # CMD ["sh", "-c", "/usr/app/credits-cli task ${task_params} && /usr/app/credits-cli start"] | ||
|
||
# # FROM dockerhub.tezign.com/tekton/cuda:11.7.0-cudnn8-runtime-ubuntu22.04 | ||
# # # RUN sed -i "s@archive.ubuntu.com@mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list && \ | ||
# # # sed -i "s@security.ubuntu.com@mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list | ||
|
||
# # RUN apt-get update && \ | ||
# # apt-get install -y curl build-essential libssl-dev pkg-config | ||
|
||
# # RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
||
# # ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# # WORKDIR /usr/app/ | ||
|
||
# # COPY . . | ||
|
||
# # RUN echo '[source.crates-io]' > ~/.cargo/config \ | ||
# # && echo "replace-with = 'ustc'" >> ~/.cargo/config \ | ||
# # && echo '[source.ustc]' >> ~/.cargo/config \ | ||
# # && echo 'registry = "git://mirrors.ustc.edu.cn/crates.io-index"' >> ~/.cargo/config | ||
|
||
# # RUN cargo build --release | ||
|
||
# # ENV start_params " " | ||
|
||
# # EXPOSE 8080 | ||
# # CMD ["sh", "-c", "./credits-cli task $task_params && ./credits-cli start"] |