-
Notifications
You must be signed in to change notification settings - Fork 155
/
Dockerfile
59 lines (37 loc) · 1.29 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM archlinux:base-devel AS base
RUN pacman -Syu --noconfirm
# Install dependancies needed by all steps including runtime step
RUN pacman -S --noconfirm --needed aom ffmpeg vapoursynth ffms2 libvpx mkvtoolnix-cli svt-av1 vmaf
FROM base AS build-base
# Install dependancies needed by build steps
RUN pacman -S --noconfirm --needed rust clang nasm git
RUN cargo install cargo-chef
WORKDIR /tmp/Av1an
FROM build-base AS planner
COPY . .
RUN cargo chef prepare
FROM build-base AS build
COPY --from=planner /tmp/Av1an/recipe.json recipe.json
RUN cargo chef cook --release
# Compile rav1e from git, as archlinux is still on rav1e 0.4
RUN git clone https://github.com/xiph/rav1e && \
cd rav1e && \
cargo build --release && \
strip ./target/release/rav1e && \
mv ./target/release/rav1e /usr/local/bin && \
cd .. && rm -rf ./rav1e
# Build av1an
COPY . /tmp/Av1an
RUN cargo build --release && \
mv ./target/release/av1an /usr/local/bin && \
cd .. && rm -rf ./Av1an
FROM base AS runtime
ENV MPLCONFIGDIR="/home/app_user/"
COPY --from=build /usr/local/bin/rav1e /usr/local/bin/rav1e
COPY --from=build /usr/local/bin/av1an /usr/local/bin/av1an
# Create user
RUN useradd -ms /bin/bash app_user
USER app_user
VOLUME ["/videos"]
WORKDIR /videos
ENTRYPOINT [ "/usr/local/bin/av1an" ]