Skip to content

Commit

Permalink
v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ouyangkang committed Mar 13, 2024
1 parent 41dee90 commit 6a461ef
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 126 deletions.
78 changes: 38 additions & 40 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,38 @@ 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
# 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


# 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

# # COPY dockerfileconfig/sources.list /etc/apt/sources.list
COPY 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 cat /etc/apt/sources.list
RUN rm -Rf /var/lib/apt/lists/*
RUN apt-get update

# RUN apt-get install -y libssl-dev pkg-config
RUN apt-get install -y libssl-dev pkg-config

# COPY dockerfileconfig/config /root/.cargo/config
COPY dockerfileconfig/config /root/.cargo/config

RUN cargo build --release

FROM debian:buster-slim
FROM debian:bookworm-slim


# 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
COPY --from=builder /etc/apt/sources.list /etc/apt/sources.list

# 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

Expand All @@ -51,39 +49,39 @@ EXPOSE 8080
CMD ["sh", "-c", "./credits-cli task $task_params && ./credits-cli start"]


# # # ENV start_params=" "
# # ENV start_params=" "


# # # FROM dockerhub.tezign.com/innovation/muse-credits/muse-credits:v1.6
# # FROM dockerhub.tezign.com/innovation/muse-credits/muse-credits:v1.6

# # # ENV start_params=" "
# # ENV start_params=" "

# # # EXPOSE 8080
# # # CMD ["sh", "-c", "/usr/app/credits-cli task ${task_params} && /usr/app/credits-cli start"]
# # 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
# 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 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
# RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

# # ENV PATH="/root/.cargo/bin:${PATH}"
# ENV PATH="/root/.cargo/bin:${PATH}"

# # WORKDIR /usr/app/
# WORKDIR /usr/app/

# # COPY . .
# 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 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
# RUN cargo build --release

# # ENV start_params " "
# ENV start_params " "

# # EXPOSE 8080
# # CMD ["sh", "-c", "./credits-cli task $task_params && ./credits-cli start"]
# EXPOSE 8080
# CMD ["sh", "-c", "./credits-cli task $task_params && ./credits-cli start"]
100 changes: 14 additions & 86 deletions Dockerfile.gitlab
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"]

0 comments on commit 6a461ef

Please sign in to comment.