Skip to content

Commit 3570fd6

Browse files
authored
HDDS-14229. Create slim ozone-runner image (#51)
1 parent 1aa8dee commit 3570fd6

File tree

1 file changed

+4
-93
lines changed

1 file changed

+4
-93
lines changed

Dockerfile

Lines changed: 4 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -14,67 +14,23 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
FROM golang:1.17.8-buster AS go
18-
RUN go install github.com/rexray/gocsi/csc@latest
19-
2017
FROM rockylinux:9.3
2118
RUN set -eux ; \
2219
dnf install -y \
2320
bzip2 \
24-
diffutils \
2521
findutils \
26-
fuse \
27-
jq \
22+
java-21-openjdk-headless \
2823
krb5-workstation \
2924
libxcrypt-compat \
30-
lsof \
3125
ncurses \
32-
net-tools \
33-
nmap-ncat \
3426
openssl \
3527
procps \
36-
python3 python3-pip \
3728
snappy \
3829
sudo \
3930
unzip \
4031
zlib \
41-
&& dnf clean all \
42-
&& ln -sf /usr/bin/python3 /usr/bin/python
43-
RUN sudo python3 -m pip install --upgrade pip
44-
45-
# CSI / k8s / fuse / goofys dependency
46-
COPY --from=go /go/bin/csc /usr/bin/csc
47-
# S3 FUSE support - mountpoint-s3
48-
ARG MOUNTPOINT_S3_VERSION=1.19.0
49-
RUN set -eux ; \
50-
ARCH="$(arch)"; \
51-
case "${ARCH}" in \
52-
x86_64) arch='x86_64' ;; \
53-
aarch64) arch='arm64' ;; \
54-
*) echo "Unsupported architecture: ${ARCH}"; exit 1 ;; \
55-
esac; \
56-
curl -L "https://s3.amazonaws.com/mountpoint-s3-release/${MOUNTPOINT_S3_VERSION}/${arch}/mount-s3-${MOUNTPOINT_S3_VERSION}-${arch}.rpm" -o mount-s3.rpm ; \
57-
dnf install -y mount-s3.rpm ; \
58-
rm -f mount-s3.rpm
32+
&& dnf clean all
5933

60-
# Install rclone for smoketest
61-
ARG RCLONE_VERSION=1.69.3
62-
RUN set -eux ; \
63-
ARCH="$(arch)" ; \
64-
case "${ARCH}" in \
65-
x86_64) arch='amd64' ;; \
66-
aarch64) arch='arm64' ;; \
67-
*) echo "Unsupported architecture: ${ARCH}"; exit 1 ;; \
68-
esac; \
69-
curl -L -o /tmp/package.rpm "https://downloads.rclone.org/v${RCLONE_VERSION}/rclone-v${RCLONE_VERSION}-linux-${arch}.rpm"; \
70-
dnf install -y /tmp/package.rpm; \
71-
rm -f /tmp/package.rpm
72-
73-
74-
#For executing inline smoketest
75-
RUN set -eux ; \
76-
pip3 install awscli==1.38.15 robotframework==6.1.1 boto3==1.37.15 ; \
77-
rm -r ~/.cache/pip
7834

7935
#dumb init for proper init handling
8036
RUN set -eux ; \
@@ -95,30 +51,6 @@ RUN set -eux ; \
9551
chmod +x dumb-init ; \
9652
mv dumb-init /usr/local/bin/dumb-init
9753

98-
#byteman test for development
99-
ARG BYTEMAN_VERSION=4.0.25
100-
ENV BYTEMAN_HOME=/opt/byteman
101-
RUN cd /tmp && \
102-
curl -L -o byteman.zip https://downloads.jboss.org/byteman/${BYTEMAN_VERSION}/byteman-download-${BYTEMAN_VERSION}-bin.zip && \
103-
unzip -j -d byteman byteman.zip && \
104-
sudo mkdir -p ${BYTEMAN_HOME}/lib && \
105-
sudo mv byteman/byteman.jar byteman/byteman-submit.jar ${BYTEMAN_HOME}/lib/ && \
106-
sudo mv byteman/bmsubmit.sh /usr/local/bin/bmsubmit && \
107-
sudo chmod +x /usr/local/bin/bmsubmit && \
108-
sudo rm -rf byteman.zip byteman && \
109-
sudo chmod -R a+rX ${BYTEMAN_HOME} && \
110-
sudo ln -s ${BYTEMAN_HOME}/lib/byteman.jar /opt/byteman.jar
111-
112-
#async profiler for development profiling
113-
RUN set -eux ; \
114-
ARCH="$(arch)" ; \
115-
case "${ARCH}" in \
116-
x86_64) url='https://github.com/jvm-profiling-tools/async-profiler/releases/download/v2.9/async-profiler-2.9-linux-x64.tar.gz' ;; \
117-
aarch64) url='https://github.com/jvm-profiling-tools/async-profiler/releases/download/v2.9/async-profiler-2.9-linux-arm64.tar.gz' ;; \
118-
*) echo "Unsupported architecture: ${ARCH}"; exit 1 ;; \
119-
esac; \
120-
curl -L ${url} | tar xvz ; \
121-
mv async-profiler-* /opt/profiler
12254

12355
# Hadoop native libary (Hadoop 3.4.1 doesn't have aarch64 binary)
12456
RUN set -eux ; \
@@ -135,33 +67,12 @@ RUN set -eux ; \
13567
rm -rf /tmp/hadoop-${hadoop_version} && \
13668
rm -f hadoop-${hadoop_version}.tar.gz
13769

138-
# OpenJDK 21
139-
RUN set -eux ; \
140-
ARCH="$(arch)"; \
141-
case "${ARCH}" in \
142-
x86_64) \
143-
url='https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/13/GPL/openjdk-21.0.2_linux-x64_bin.tar.gz'; \
144-
sha256='a2def047a73941e01a73739f92755f86b895811afb1f91243db214cff5bdac3f'; \
145-
;; \
146-
aarch64) \
147-
url='https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/13/GPL/openjdk-21.0.2_linux-aarch64_bin.tar.gz'; \
148-
sha256='08db1392a48d4eb5ea5315cf8f18b89dbaf36cda663ba882cf03c704c9257ec2'; \
149-
;; \
150-
*) echo "Unsupported architecture: ${ARCH}"; exit 1 ;; \
151-
esac && \
152-
curl -L ${url} -o openjdk.tar.gz && \
153-
echo "${sha256} *openjdk.tar.gz" | sha256sum -c - && \
154-
tar xzvf openjdk.tar.gz -C /usr/local && \
155-
rm -f openjdk.tar.gz
156-
157-
ENV JAVA_HOME=/usr/local/jdk-21.0.2
158-
# compatibility with Ozone 1.4.0 and earlier compose env.
159-
RUN mkdir -p /usr/lib/jvm && ln -s $JAVA_HOME /usr/lib/jvm/jre
70+
ENV JAVA_HOME=/usr/lib/jvm/jre-21-openjdk
16071

16172
ENV PATH=/opt/hadoop/libexec:$PATH:$JAVA_HOME/bin:/opt/hadoop/bin
16273

16374
RUN id=1000; \
164-
for u in hadoop om dn scm s3g recon testuser testuser2 httpfs; do \
75+
for u in hadoop om dn scm s3g recon httpfs; do \
16576
groupadd --gid $id $u \
16677
&& useradd --uid $id $u --gid $id --home /opt/$u \
16778
&& mkdir /opt/$u \

0 commit comments

Comments
 (0)