Skip to content

Commit

Permalink
コンテナの細かい設定を行う
Browse files Browse the repository at this point in the history
  • Loading branch information
higumachan committed Dec 15, 2023
1 parent 9d5195d commit a222dbc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test-environment/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
FROM rust:1-bookworm as builder

COPY ./ /app

WORKDIR /app
RUN cargo build --release
RUN apt install -y git
RUN mkdir /repos
WORKDIR /repos
RUN apt install -y git
RUN git clone https://github.com/rust-lang/cargo.git
RUN cd cargo && cargo build
RUN cargo new alice && cd alice && cargo build
Expand All @@ -15,9 +11,13 @@ RUN cargo new carol && cd carol && cargo build
RUN cargo new dave && cd dave && cargo build
RUN cargo new eve && cd eve && cargo build
RUN cargo new kuma && cd kuma && cargo build
COPY ./ /app
WORKDIR /app
RUN cargo build --release

FROM debian:bookworm-slim
RUN mkdir /app
RUN apt update && apt install -y curl
COPY --from=builder /app/target/release/cargo-cleaner /app/cargo-cleaner
COPY --from=builder /repos/cargo /root/cargo
COPY --from=builder /repos/alice /root/alice
Expand All @@ -26,3 +26,8 @@ COPY --from=builder /repos/carol /root/carol
COPY --from=builder /repos/dave /root/dave
COPY --from=builder /repos/eve /root/eve
COPY --from=builder /repos/kuma /root/kuma
RUN curl -sS https://starship.rs/install.sh > /tmp/install.sh
RUN sh /tmp/install.sh -y
RUN echo 'eval "$(starship init bash)"' > /root/.bashrc
RUN echo 'export PATH=$PATH:/app/' >> /root/.bashrc
WORKDIR /root

0 comments on commit a222dbc

Please sign in to comment.