From bdd75c1aa379322c8d5214c087fbbf6e44ee407c Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Mon, 25 Mar 2024 01:33:03 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20Dockerfile=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ff97695 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +# syntax=docker/dockerfile:1.6 +FROM lukemathwalker/cargo-chef:latest-rust-1.77-slim AS chef +WORKDIR /app + +FROM chef AS planner +COPY --link . . +RUN cargo chef prepare --recipe-path recipe.json + +FROM chef AS build-env +COPY --from=planner --link /app/recipe.json recipe.json + +# Build dependencies - this is the caching Docker layer! +RUN cargo chef cook --release --recipe-path recipe.json + +# Build application +COPY --link . . +RUN cargo build --release + +FROM ubuntu:22.04 +LABEL org.opencontainers.image.source=https://github.com/GiganticMinecraft/seichiassist-downloader +RUN apt-get update -y && \ + apt-get install -y git curl gnupg && \ + git clone https://github.com/GiganticMinecraft/SeichiAssist.git + +# sbt 公式リポジトリを追加 +RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list && \ + echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list && \ + curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add + +# sbt をインストール +RUN apt-get update && \ + apt-get install -y sbt + +COPY --from=build-env --link /app/target/release/seichiassist-downloader / +CMD ["./seichiassist-downloader"] +