Skip to content

Commit

Permalink
Create Dockerfile (#190)
Browse files Browse the repository at this point in the history
* Create Dockerfile

Added a Dockerfile that support both amd64 and arm64.

* Update Dockerfile
  • Loading branch information
synost committed Feb 10, 2024
1 parent 42bcdc1 commit 98dd3f6
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Dockerfile
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"]

0 comments on commit 98dd3f6

Please sign in to comment.