summaryrefslogtreecommitdiff
path: root/.gitlab/ci/docker/fedora37/Dockerfile
blob: b36a17ed24e9dac3546cdecf3beab1d49fcda11c (plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# syntax=docker/dockerfile:1

ARG BASE_IMAGE=fedora:37

FROM ${BASE_IMAGE} AS dnf-cache
# Populate DNF cache w/ the fresh metadata and prefetch packages.
RUN --mount=type=bind,source=clang_tidy_headers_packages.lst,target=/root/clang_tidy_headers_packages.lst \
    --mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \
    --mount=type=bind,source=iwyu_packages.lst,target=/root/iwyu_packages.lst \
    --mount=type=bind,source=rvm_packages.lst,target=/root/rvm_packages.lst \
    --mount=type=tmpfs,target=/var/log \
    --mount=type=tmpfs,target=/tmp \
    dnf install \
        --setopt=install_weak_deps=False \
        --setopt=fastestmirror=True \
        --setopt=max_parallel_downloads=10 \
        --downloadonly \
        -y \
        $(grep -h '^[^#]\+$' /root/*.lst)


FROM ${BASE_IMAGE} AS rvm-build
LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"

RUN --mount=type=bind,source=install_rvm.sh,target=/root/install_rvm.sh \
    --mount=type=bind,source=rvm_packages.lst,target=/root/rvm_packages.lst \
    --mount=type=cache,from=dnf-cache,source=/var/cache/dnf,target=/var/cache/dnf,sharing=private \
    --mount=type=tmpfs,target=/var/log \
    --mount=type=tmpfs,target=/tmp \
    sh /root/install_rvm.sh


FROM ${BASE_IMAGE} AS clang-tidy-headers
LABEL maintainer="Kyle Edwards <kyle.edwards@kitware.com>"

RUN --mount=type=bind,source=install_clang_tidy_headers.sh,target=/root/install_clang_tidy_headers.sh \
    --mount=type=bind,source=clang_tidy_headers_packages.lst,target=/root/clang_tidy_headers_packages.lst \
    --mount=type=cache,from=dnf-cache,source=/var/cache/dnf,target=/var/cache/dnf,sharing=private \
    --mount=type=tmpfs,target=/var/log \
    --mount=type=tmpfs,target=/tmp \
    sh /root/install_clang_tidy_headers.sh


FROM ${BASE_IMAGE} AS iwyu-build
LABEL maintainer="Kyle Edwards <kyle.edwards@kitware.com>"

RUN --mount=type=bind,source=install_iwyu.sh,target=/root/install_iwyu.sh \
    --mount=type=bind,source=iwyu_packages.lst,target=/root/iwyu_packages.lst \
    --mount=type=cache,from=dnf-cache,source=/var/cache/dnf,target=/var/cache/dnf,sharing=private \
    --mount=type=tmpfs,target=/var/log \
    --mount=type=tmpfs,target=/tmp \
    sh /root/install_iwyu.sh


FROM ${BASE_IMAGE}
LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"

RUN --mount=type=bind,source=install_deps.sh,target=/root/install_deps.sh \
    --mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \
    --mount=type=cache,from=dnf-cache,source=/var/cache/dnf,target=/var/cache/dnf,sharing=private \
    --mount=type=cache,target=/var/cache/pip \
    --mount=type=tmpfs,target=/var/log \
    --mount=type=tmpfs,target=/tmp \
    sh /root/install_deps.sh

RUN --mount=type=bind,from=rvm-build,source=/root,target=/root \
    tar -C /usr/local -xf /root/rvm.tar

RUN --mount=type=bind,from=clang-tidy-headers,source=/root,target=/root \
    tar -C /usr/include -xf /root/clang-tidy-headers.tar

RUN --mount=type=bind,from=iwyu-build,source=/root,target=/root \
    tar -C / -xf /root/iwyu.tar