-
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
Showing
1 changed file
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] | ||
|