-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile.template
51 lines (46 loc) · 2.63 KB
/
Dockerfile.template
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
${UBI_IMAGE}
USER root
ENV \
LANG="en_US.UTF-8" \
LANGUAGE="en_US:en" \
LC_ALL="en_US.UTF-8" \
APP_HOME="/root" \
HOME="/root" \
NSS_WRAPPER_PASSWD="/etc/passwd" \
UBI=${UBI}
RUN microdnf --setopt=install_weak_deps=0 --setopt=tsflags=nodocs install -y ${UBI_PKGS} \
&& rpm -q ${UBI_PKGS}
RUN if [ "$UBI" = "8" ] ; then rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8 \
&& rpm -q gpg-pubkey-8483c65d-5ccc5b19 \
# XXX: RHEL 8 does not have ninja-build, so grabbing from CentOS 8
&& wget --no-verbose https://vault.centos.org/centos/8/PowerTools/x86_64/os/Packages/ninja-build-1.8.2-1.el8.x86_64.rpm \
&& rpm -K ninja-build-1.8.2-1.el8.x86_64.rpm \
&& rpm -ivh ninja-build-1.8.2-1.el8.x86_64.rpm \
&& rm ninja-build-1.8.2-1.el8.x86_64.rpm \
&& rpm -q ninja-build \
# XXX: RHEL 8 does not have OpenJDK 23, so grabbing from Fedora
&& wget --no-verbose https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/j/java-latest-openjdk-devel-23.0.0.0.37-1.rolling.el8.x86_64.rpm https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/j/java-latest-openjdk-23.0.0.0.37-1.rolling.el8.x86_64.rpm https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/j/java-latest-openjdk-headless-23.0.0.0.37-1.rolling.el8.x86_64.rpm \
&& rpm -K java-latest-openjdk-devel-23.0.0.0.37-1.rolling.el8.x86_64.rpm java-latest-openjdk-23.0.0.0.37-1.rolling.el8.x86_64.rpm java-latest-openjdk-headless-23.0.0.0.37-1.rolling.el8.x86_64.rpm \
&& rpm -ivh java-latest-openjdk-devel-23.0.0.0.37-1.rolling.el8.x86_64.rpm java-latest-openjdk-23.0.0.0.37-1.rolling.el8.x86_64.rpm java-latest-openjdk-headless-23.0.0.0.37-1.rolling.el8.x86_64.rpm \
&& rm java-latest-openjdk-devel-23.0.0.0.37-1.rolling.el8.x86_64.rpm java-latest-openjdk-23.0.0.0.37-1.rolling.el8.x86_64.rpm java-latest-openjdk-headless-23.0.0.0.37-1.rolling.el8.x86_64.rpm \
&& rpm -q java-latest-openjdk-devel ; \
fi
RUN set -o errexit -o nounset \
# Using rm rather than microdnf clean to clear package manager metadata
&& rm -rf "/var/cache/yum" "/var/lib/rpm" "/var/lib/dnf" \
&& mkdir /project \
&& mkdir /opt/gradle \
&& mkdir /opt/sbt \
&& mkdir /opt/ant \
&& mkdir /opt/maven \
&& chown 185:185 /project \
$TOOL_STRING
LABEL \
io.k8s.description="Konflux Builder Image for building Java components." \
io.k8s.display-name="Konflux Builder Image" \
io.openshift.tags="builder,java,jbs" \
maintainer="Nick Cross <[email protected]>"
# Define the user
USER 185
# Define the working directory
WORKDIR /project