Skip to content

Commit 23f533d

Browse files
authored
Merge pull request #8567 from liranmauda/liran-reduce-image-size
Reducing NooBaa Upstream Image Size
2 parents 7bc814b + cfb77cf commit 23f533d

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

src/deploy/NVA_build/NooBaa.Dockerfile

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@ RUN tar \
3333

3434
#####################################################################################################################################
3535

36+
FROM quay.io/centos/centos:stream${CENTOS_VER} AS noobaa-base
37+
38+
##############################################################
39+
# Layers:
40+
# Title: Copying the tar file from the server_builder
41+
# Size: ~ 230 MB
42+
# Cache: Rebuild when there is a new tar file.
43+
##############################################################
44+
COPY --from=server_builder /noobaa/noobaa-NVA.tar.gz /tmp/
45+
RUN mkdir -m 777 /root/node_modules && \
46+
cd /root/node_modules && \
47+
tar -xzf /tmp/noobaa-NVA.tar.gz && \
48+
chgrp -R 0 /root/node_modules && \
49+
chmod -R 775 /root/node_modules
50+
51+
#####################################################################################################################################
52+
3653
##############################################################
3754
# Title: Start of the Server Image
3855
# Size: ~ 841 MB
@@ -41,6 +58,8 @@ RUN tar \
4158

4259
FROM quay.io/centos/centos:stream${CENTOS_VER} AS noobaa
4360

61+
# an arg to control if we install parquet-libs or not
62+
ARG BUILD_S3SELECT_PARQUET=0
4463
# The ports are overridden for Ceph Test later
4564
ENV container=docker
4665
ENV PORT=8080
@@ -56,11 +75,11 @@ ENV ENDPOINT_NODE_OPTIONS=''
5675
# Layers:
5776
# Title: Installing dependencies
5877
# Size: ~ 272 MB
59-
# Cache: Rebuild when we adding/removing requirments
78+
# Cache: Rebuild when we adding/removing requirements
6079
##############################################################
6180

62-
RUN dnf install -y epel-release
63-
RUN dnf install -y -q bash \
81+
RUN dnf install -y epel-release && \
82+
dnf install -y -q bash \
6483
boost \
6584
lsof \
6685
procps \
@@ -79,7 +98,6 @@ RUN dnf install -y -q bash \
7998
dnf clean all
8099

81100
COPY ./src/deploy/NVA_build/install_arrow_run.sh ./src/deploy/NVA_build/install_arrow_run.sh
82-
ARG BUILD_S3SELECT_PARQUET=0
83101
RUN ./src/deploy/NVA_build/install_arrow_run.sh $BUILD_S3SELECT_PARQUET
84102

85103
##############################################################
@@ -95,7 +113,7 @@ RUN chmod +x ./install_nodejs.sh && \
95113

96114
##############################################################
97115
# Layers:
98-
# Title: Copying and giving premissions
116+
# Title: Copying and giving permissions
99117
# Size: ~ 1 MB
100118
# Cache: Rebuild when we need to add another copy
101119
#
@@ -120,25 +138,14 @@ RUN chmod 775 /noobaa_init_files && \
120138
chgrp -R 0 /noobaa_init_files/ && \
121139
chmod -R g=u /noobaa_init_files/
122140

123-
124141
COPY --from=server_builder /kubectl /usr/local/bin/kubectl
125142
COPY --from=server_builder ./noobaa_init_files/kube_pv_chown /noobaa_init_files
126143
RUN mkdir -m 777 /root/node_modules && \
127144
chown root:root /noobaa_init_files/kube_pv_chown && \
128145
chmod 750 /noobaa_init_files/kube_pv_chown && \
129146
chmod u+s /noobaa_init_files/kube_pv_chown
130147

131-
##############################################################
132-
# Layers:
133-
# Title: Copying the tar file from the server_builder
134-
# Size: ~ 153 MB
135-
# Cache: Rebuild when there is a new tar file.
136-
##############################################################
137-
COPY --from=server_builder /noobaa/noobaa-NVA.tar.gz /tmp/
138-
RUN cd /root/node_modules && \
139-
tar -xzf /tmp/noobaa-NVA.tar.gz && \
140-
chgrp -R 0 /root/node_modules && \
141-
chmod -R 775 /root/node_modules
148+
COPY --from=noobaa-base /root/node_modules /root/node_modules
142149

143150
###############
144151
# PORTS SETUP #
@@ -155,9 +162,6 @@ EXPOSE 26050
155162
# Needs to be added only after installing jemalloc in dependencies section (our env section is before) - otherwise it will fail
156163
ENV LD_PRELOAD=/usr/lib64/libjemalloc.so.2
157164

158-
#RUN mkdir -p /nsfs/fs1/amitpb && chmod -R 777 /nsfs/
159-
#RUN mkdir -p /nsfsAA/fs1/amitpb && chmod -R 777 /nsfsAA/
160-
161165
###############
162166
# EXEC SETUP #
163167
###############

0 commit comments

Comments
 (0)