Skip to content

Commit d9b35b9

Browse files
committed
slim docker
1 parent 1aa8dee commit d9b35b9

File tree

1 file changed

+5
-92
lines changed

1 file changed

+5
-92
lines changed

Dockerfile

Lines changed: 5 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -14,67 +14,22 @@
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 \
2822
krb5-workstation \
2923
libxcrypt-compat \
30-
lsof \
3124
ncurses \
32-
net-tools \
33-
nmap-ncat \
3425
openssl \
3526
procps \
36-
python3 python3-pip \
3727
snappy \
3828
sudo \
3929
unzip \
4030
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
31+
&& dnf clean all
5932

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
7833

7934
#dumb init for proper init handling
8035
RUN set -eux ; \
@@ -95,30 +50,6 @@ RUN set -eux ; \
9550
chmod +x dumb-init ; \
9651
mv dumb-init /usr/local/bin/dumb-init
9752

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
12253

12354
# Hadoop native libary (Hadoop 3.4.1 doesn't have aarch64 binary)
12455
RUN set -eux ; \
@@ -136,32 +67,14 @@ RUN set -eux ; \
13667
rm -f hadoop-${hadoop_version}.tar.gz
13768

13869
# 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
70+
RUN dnf install -y java-21-openjdk-headless && dnf clean all
15671

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
72+
ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk
16073

16174
ENV PATH=/opt/hadoop/libexec:$PATH:$JAVA_HOME/bin:/opt/hadoop/bin
16275

16376
RUN id=1000; \
164-
for u in hadoop om dn scm s3g recon testuser testuser2 httpfs; do \
77+
for u in hadoop om dn scm s3g recon httpfs; do \
16578
groupadd --gid $id $u \
16679
&& useradd --uid $id $u --gid $id --home /opt/$u \
16780
&& mkdir /opt/$u \
@@ -188,4 +101,4 @@ COPY --chmod=755 entrypoint.sh /usr/local/bin/entrypoint.sh
188101
WORKDIR /opt/hadoop
189102
USER hadoop
190103

191-
ENTRYPOINT ["/usr/local/bin/dumb-init", "--", "entrypoint.sh"]
104+
ENTRYPOINT ["/usr/local/bin/dumb-init", "--", "entrypoint.sh"]

0 commit comments

Comments
 (0)