Skip to content

Commit 9ded1b0

Browse files
committed
mount installer package instead of copy
avoids adding the copy file into the image and saves space
1 parent 7365d0c commit 9ded1b0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

docker/Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@ RUN --mount=type=cache,target=/var/cache/dnf \
1313
# clean cache jobs
1414
&& mv /etc/yum/protected.d/systemd.conf /etc/yum/protected.d/systemd.conf.bak
1515

16-
COPY $PRESTO_PKG .
1716
COPY --chmod=755 $PRESTO_CLI_JAR /opt/presto-cli
1817

19-
RUN \
18+
RUN --mount=type=bind,source=$PRESTO_PKG,target=/$PRESTO_PKG \
2019
# Download Presto and move \
21-
tar -zxf $PRESTO_PKG \
22-
&& mv ./presto-server-$PRESTO_VERSION $PRESTO_HOME \
23-
&& rm -rf $PRESTO_PKG \
24-
&& rm -rf ./presto-server-$PRESTO_VERSION \
20+
mkdir -p "$PRESTO_HOME" && \
21+
tar --strip-components=1 -C "$PRESTO_HOME" -zxf /$PRESTO_PKG \
2522
&& ln -s /opt/presto-cli /usr/local/bin/ \
2623
# mkdir for config
2724
&& mkdir -p $PRESTO_HOME/etc/catalog \

0 commit comments

Comments
 (0)