-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathexternals_builder.el8.Dockerfile
More file actions
59 lines (48 loc) · 2.05 KB
/
externals_builder.el8.Dockerfile
File metadata and controls
59 lines (48 loc) · 2.05 KB
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
# syntax=docker/dockerfile:1.5
ARG builder_base=almalinux:8
FROM ${builder_base}
SHELL [ "/usr/bin/bash", "-c" ]
# Make sure we're starting with an up-to-date image
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf update -y || [ "$?" -eq 100 ] && \
rm -rf /tmp/*
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
dnf-plugins-core \
&& \
dnf config-manager --set-enabled powertools && \
rm -rf /tmp/*
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
sudo \
git \
python3 \
python3-distro \
python3-packaging \
&& \
rm -rf /tmp/*
ARG externals_repo="https://github.com/irods/externals"
ARG externals_branch="main"
WORKDIR /externals
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
git clone "${externals_repo}" -b "${externals_branch}" /externals && \
./install_prerequisites.py && \
rm -rf /externals /tmp/*
# TODO: The following will enable the newer toolchain on interactive shell logins. The
# externals builder, however, is not an interactive shell, so this does not execute. This seems
# like a much better option than explicitly setting the PATH environment variable to check for
# new thing, as is being done below. Investigate making this effective for this builder.
#RUN echo "#!/bin/sh" > /etc/profile.d/gcc-toolset-11.sh && \
# echo "" >> /etc/profile.d/gcc-toolset-11.sh && \
# echo ". /opt/rh/gcc-toolset-11/enable" >> /etc/profile.d/gcc-toolset-11.sh
ENV PATH=/opt/rh/gcc-toolset-11/root/usr/bin:$PATH
ENV IRODS_EXTERNALS_GCC_PREFIX=/opt/rh/gcc-toolset-11/root/usr
ENV file_extension="rpm"
ENV package_manager="dnf"
WORKDIR /
COPY --chmod=755 build_and_copy_externals_to_dir.sh /
ENTRYPOINT ["./build_and_copy_externals_to_dir.sh"]