Skip to content

Commit 87f4b3c

Browse files
committed
reduce size
1 parent 0a61481 commit 87f4b3c

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

hbase/Dockerfile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
FROM stackable/image/hadoop AS hadoop-builder
55

6+
RUN chmod -R g=u /stackable
7+
68
FROM stackable/image/java-devel AS hbase-builder
79

810
ARG PRODUCT
@@ -87,6 +89,7 @@ if [ "${DELETE_CACHES}" = "true" ] ; then
8789
rm -rf /stackable/.npm/*
8890
rm -rf /stackable/.cache/*
8991
fi
92+
chmod -R g=u /stackable
9093
EOF
9194

9295
FROM stackable/image/java-devel AS opa-authorizer-builder
@@ -121,6 +124,7 @@ fi
121124
if [ "${DELETE_CACHES}" = "true" ] ; then
122125
rm -rf /stackable/.m2/repository/*
123126
fi
127+
chmod -R g=u /stackable
124128
EOF
125129

126130
FROM stackable/image/java-devel AS hbase-operator-tools-builder
@@ -186,6 +190,7 @@ if [ "${DELETE_CACHES}" = "true" ] ; then
186190
rm -rf /stackable/.npm/*
187191
rm -rf /stackable/.cache/*
188192
fi
193+
chmod -R g=u /stackable
189194
EOF
190195

191196

@@ -201,9 +206,9 @@ USER ${STACKABLE_USER_UID}
201206
WORKDIR /stackable
202207

203208
COPY --from=hadoop-builder --chown=${STACKABLE_USER_UID}:0 \
204-
/stackable/hadoop/share/hadoop/tools/lib/aws-java-sdk-bundle-*.jar \
205-
/stackable/hadoop/share/hadoop/tools/lib/hadoop-aws-${HADOOP}.jar \
206-
/stackable/hadoop/share/hadoop/tools/lib/
209+
/stackable/hadoop/share/hadoop/tools/lib/aws-java-sdk-bundle-*.jar \
210+
/stackable/hadoop/share/hadoop/tools/lib/hadoop-aws-${HADOOP}.jar \
211+
/stackable/hadoop/share/hadoop/tools/lib/
207212

208213
COPY --chown=${STACKABLE_USER_UID}:0 hbase/stackable/bin/export-snapshot-to-s3.env /stackable/bin/
209214

@@ -217,6 +222,7 @@ export LIBS=$(find /stackable/hadoop/share/hadoop -name '*.jar' -printf '%p:' |
217222
envsubst '${PRODUCT}:${LIBS}' < /stackable/bin/export-snapshot-to-s3.env > /stackable/bin/export-snapshot-to-s3
218223
chmod +x /stackable/bin/export-snapshot-to-s3
219224
rm /stackable/bin/export-snapshot-to-s3.env
225+
chmod -R g=u /stackable
220226
EOF
221227

222228
FROM stackable/image/java-devel AS phoenix-builder
@@ -277,6 +283,7 @@ if [ "${DELETE_CACHES}" = "true" ] ; then
277283
rm -rf /stackable/.npm/*
278284
rm -rf /stackable/.cache/*
279285
fi
286+
chmod -R g=u /stackable
280287
EOF
281288

282289

@@ -331,8 +338,8 @@ COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-s3-builder /stackable/hadoop/
331338
# hadoop-azure-${HADOOP}.jar contains the AzureBlobFileSystem which is required
332339
# by hadoop-common-${HADOOP}.jar if the scheme of a file system is "abfs://".
333340
COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder \
334-
/stackable/hadoop/share/hadoop/tools/lib/hadoop-azure-${HADOOP}.jar \
335-
/stackable/hbase-${PRODUCT}/lib/
341+
/stackable/hadoop/share/hadoop/tools/lib/hadoop-azure-${HADOOP}.jar \
342+
/stackable/hbase-${PRODUCT}/lib/
336343

337344
COPY --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/hbase-opa-authorizer/target/hbase-opa-authorizer*.jar /stackable/hbase-${PRODUCT}/lib
338345

@@ -350,16 +357,12 @@ microdnf install \
350357

351358
microdnf clean all
352359
rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}\n" | sort > /stackable/package_manifest.txt
360+
chmod g=u /stackable/package_manifest.txt
353361
rm -rf /var/cache/yum
354362

355363
ln --symbolic --logical --verbose "/stackable/hbase-${PRODUCT}" /stackable/hbase
356364
ln --symbolic --logical --verbose "/stackable/hbase-operator-tools-${HBASE_OPERATOR_TOOLS}" /stackable/hbase-operator-tools
357365
ln --symbolic --logical --verbose "/stackable/phoenix/phoenix-server-hbase-${HBASE_PROFILE}.jar" "/stackable/hbase/lib/phoenix-server-hbase-${HBASE_PROFILE}.jar"
358-
359-
# All files and folders owned by root group to support running as arbitrary users.
360-
# This is best practice as all container users will belong to the root group (0).
361-
chown -R ${STACKABLE_USER_UID}:0 /stackable
362-
chmod -R g=u /stackable
363366
EOF
364367

365368
# ----------------------------------------

0 commit comments

Comments
 (0)