|
1 |
| -FROM archlinux:base-devel AS planner |
2 |
| -RUN pacman -Syy --noconfirm |
| 1 | +FROM archlinux:base-devel AS base |
3 | 2 |
|
4 |
| -# Install all dependencies (except for rav1e) |
5 |
| -RUN pacman -S --noconfirm rsync rust clang nasm git aom ffmpeg vapoursynth ffms2 libvpx mkvtoolnix-cli svt-av1 vapoursynth-plugin-lsmashsource vmaf |
| 3 | +RUN pacman -Syy --noconfirm |
6 | 4 |
|
7 |
| -WORKDIR /tmp/Av1an |
8 |
| -RUN cargo install cargo-chef |
9 |
| -COPY . . |
10 |
| -RUN cargo chef prepare --recipe-path recipe.json |
| 5 | +# Install dependancies needed by all steps including runtime step |
| 6 | +RUN pacman -S --noconfirm aom ffmpeg vapoursynth ffms2 libvpx mkvtoolnix-cli svt-av1 vapoursynth-plugin-lsmashsource vmaf |
11 | 7 |
|
12 | 8 |
|
| 9 | +FROM base AS build-base |
13 | 10 |
|
| 11 | +# Install dependancies needed by build steps |
| 12 | +RUN pacman -S --noconfirm rust clang nasm git |
14 | 13 |
|
15 |
| -FROM archlinux:base-devel AS cacher |
16 |
| -RUN pacman -Syy --noconfirm |
| 14 | +RUN cargo install cargo-chef |
| 15 | +WORKDIR /tmp/Av1an |
17 | 16 |
|
18 |
| -# Install all dependencies (except for rav1e) |
19 |
| -RUN pacman -S --noconfirm rsync rust clang nasm git aom ffmpeg vapoursynth ffms2 libvpx mkvtoolnix-cli svt-av1 vapoursynth-plugin-lsmashsource vmaf |
20 | 17 |
|
21 |
| -WORKDIR /tmp/Av1an |
22 |
| -RUN cargo install cargo-chef |
23 |
| -COPY --from=planner /tmp/Av1an/recipe.json recipe.json |
24 |
| -RUN cargo chef cook --release --recipe-path recipe.json |
| 18 | +FROM build-base AS planner |
25 | 19 |
|
| 20 | +COPY . . |
| 21 | +RUN cargo chef prepare --recipe-path recipe.json |
26 | 22 |
|
27 | 23 |
|
| 24 | +FROM build-base AS cacher |
28 | 25 |
|
29 |
| -FROM archlinux:base-devel AS build |
| 26 | +COPY --from=planner /tmp/Av1an/recipe.json recipe.json |
| 27 | +RUN cargo chef cook --release --recipe-path recipe.json |
30 | 28 |
|
31 |
| -RUN pacman -Syy --noconfirm |
32 | 29 |
|
33 |
| -# Install all dependencies (except for rav1e) |
34 |
| -RUN pacman -S --noconfirm rsync rust clang nasm git aom ffmpeg vapoursynth ffms2 libvpx mkvtoolnix-cli svt-av1 vapoursynth-plugin-lsmashsource vmaf |
| 30 | +FROM build-base AS build |
35 | 31 |
|
36 | 32 | # Compile rav1e from git, as archlinux is still on rav1e 0.4
|
37 |
| -RUN git clone https://github.com/xiph/rav1e /tmp/rav1e |
38 |
| -WORKDIR /tmp/rav1e |
39 |
| -RUN cargo build --release && \ |
40 |
| - strip ./target/release/rav1e |
41 |
| -RUN mv ./target/release/rav1e /usr/local/bin |
| 33 | +RUN git clone https://github.com/xiph/rav1e && \ |
| 34 | + cd rav1e && \ |
| 35 | + cargo build --release && \ |
| 36 | + strip ./target/release/rav1e && \ |
| 37 | + mv ./target/release/rav1e /usr/local/bin && \ |
| 38 | + cd .. && rm -rf ./rav1e |
42 | 39 |
|
43 | 40 | # Build av1an
|
44 | 41 | COPY . /tmp/Av1an
|
45 | 42 |
|
46 | 43 | # Copy over the cached dependencies
|
47 | 44 | COPY --from=cacher /tmp/Av1an/target /tmp/Av1an/target
|
48 | 45 |
|
49 |
| -WORKDIR /tmp/Av1an |
50 |
| -RUN cargo build --release |
51 |
| -RUN mv ./target/release/av1an /usr/local/bin |
52 |
| - |
| 46 | +RUN cargo build --release && \ |
| 47 | + mv ./target/release/av1an /usr/local/bin && \ |
| 48 | + cd .. && rm -rf ./Av1an |
53 | 49 |
|
54 | 50 |
|
55 |
| -FROM archlinux:base-devel AS runtime |
| 51 | +FROM base AS runtime |
56 | 52 |
|
57 | 53 | ENV MPLCONFIGDIR="/home/app_user/"
|
58 | 54 |
|
59 |
| -RUN pacman -Syy --noconfirm |
60 |
| - |
61 |
| -# Install all optional dependencies (except for rav1e) |
62 |
| -RUN pacman -S --noconfirm aom ffmpeg vapoursynth ffms2 libvpx mkvtoolnix-cli svt-av1 vapoursynth-plugin-lsmashsource vmaf |
63 |
| - |
64 | 55 | COPY --from=build /usr/local/bin/rav1e /usr/local/bin/rav1e
|
65 | 56 | COPY --from=build /usr/local/bin/av1an /usr/local/bin/av1an
|
66 | 57 |
|
|
0 commit comments