-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create Dockerfile Added a Dockerfile that support both amd64 and arm64. * Update Dockerfile
- Loading branch information
Showing
1 changed file
with
31 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,31 @@ | ||
FROM rust:latest as builder | ||
|
||
WORKDIR /build | ||
|
||
COPY Cargo.toml Cargo.lock ./ | ||
COPY src ./src | ||
|
||
RUN cargo fetch | ||
RUN cargo build --release | ||
|
||
FROM debian:bookworm-slim as runtime | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
wget \ | ||
xz-utils \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN dpkgArch="$(dpkg --print-architecture)" \ | ||
&& case "${dpkgArch##*-}" in \ | ||
amd64) wget https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n6.1-latest-linux64-gpl-6.1.tar.xz -O /tmp/ffmpeg.tar.xz && \ | ||
tar -xvf /tmp/ffmpeg.tar.xz && cd ffmpeg-n6.1-latest-linux64-gpl-6.1/bin && mv ffmpeg ffprobe /usr/local/bin ;; \ | ||
arm64) wget https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n6.1-latest-linuxarm64-gpl-6.1.tar.xz -O /tmp/ffmpeg.tar.xz && \ | ||
tar -xvf /tmp/ffmpeg.tar.xz && cd ffmpeg-n6.1-latest-linuxarm64-gpl-6.1/bin && mv ffmpeg ffprobe /usr/local/bin ;; \ | ||
*) echo "Unsupported architecture: ${dpkgArch}"; exit 1 ;; \ | ||
esac | ||
|
||
COPY --from=builder /build/target/release/ab-av1 /app/ab-av1 | ||
|
||
WORKDIR /videos | ||
|
||
ENTRYPOINT ["/app/ab-av1"] |