-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
78 lines (67 loc) · 2.44 KB
/
Dockerfile
File metadata and controls
78 lines (67 loc) · 2.44 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# syntax=docker/dockerfile:1.20.0@sha256:26147acbda4f14c5add9946e2fd2ed543fc402884fd75146bd342a7f6271dc1d
# check=error=true
#
# Base image for builder stages in Java based products
#
FROM local-image/stackable-devel
ARG PRODUCT_VERSION
ARG STACKABLE_USER_UID
# Find the latest version here: https://github.com/apache/maven/releases
# renovate: datasource=github-tags packageName=apache/maven
ARG MAVEN_VERSION="3.9.11"
# See: https://adoptium.net/en-gb/installation/linux/#_centosrhelfedora_instructions
RUN cat <<EOF > /etc/yum.repos.d/adoptium.repo
[Adoptium]
[Adoptium]
name=Adoptium
# The adoptium mirror times-out often, so we have created a pull-through cache
# baseurl=https://packages.adoptium.net/artifactory/rpm/rhel/\$releasever/\$basearch
baseurl=https://build-repo.stackable.tech/repository/Adoptium/\$releasever/\$basearch
enabled=1
gpgcheck=1
gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public
EOF
RUN <<EOF
microdnf update
microdnf install \
cmake \
cyrus-sasl-devel \
`# diff is required by maven during the build of hbase` \
`# Cannot run program "diff" (in directory "/stackable/hbase-2.4.12-src/hbase-shaded/hbase-shaded-check-invariants"` \
diffutils \
fuse-devel \
gcc \
gcc-c++ \
`# The GNU gettext utilities contain the envsubst program which` \
`# substitutes the values of environment variables.` \
gettext \
`# For the apply_patches.sh script`\
git \
`# Needed by the maven ant run plugin for the "set-hostname-property" step in zookeeper` \
hostname \
`# Needed for compiling Java projects` \
"temurin-${PRODUCT_VERSION}-jdk" \
krb5-devel \
libcurl-devel \
make \
openssl-devel \
`# Required to unpack Omid tarball` \
tar \
wget \
which \
xz \
zlib-devel
microdnf clean all
rm -rf /var/cache/yum
curl "https://repo.stackable.tech/repository/packages/maven/apache-maven-${MAVEN_VERSION}-bin.tar.gz" | tar -xzC /tmp
mv /tmp/apache-maven-${MAVEN_VERSION} /opt/maven
ln -s /opt/maven/bin/mvn /usr/bin/mvn
EOF
ENV JAVA_HOME="/usr/lib/jvm/temurin-${PRODUCT_VERSION}-jdk"
ENV MAVEN_ARGS="--batch-mode --no-transfer-progress"
COPY --chown=${STACKABLE_USER_UID}:0 java-devel/stackable/settings.xml /stackable/.m2/settings.xml
COPY --chown=${STACKABLE_USER_UID}:0 java-devel/stackable/settings.xml /root/.m2/settings.xml
# Mitigation for CVE-2021-44228 (Log4Shell)
# This variable is supported as of Log4j version 2.10 and
# disables the vulnerable feature
ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true