Skip to content

Commit 6208c2f

Browse files
committed
Optimize Dockerfile for clarity and minimalism
- Simplified script installation using `basename` for better readability - Pruned additional unused files from mingw sysroot to further slim down image Signed-off-by: nanake <[email protected]>
1 parent 5ff1dba commit 6208c2f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

images/base-win32/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ RUN <<EOF
3939
EOF
4040

4141
RUN --mount=src=.,dst=/input <<EOF
42-
for s in /input/*.sh; do cp $s /usr/bin/$(echo $s | sed -e 's|.*/||' -e 's/\.sh$//'); done
42+
for s in /input/*.sh; do cp "$s" /usr/bin/$(basename "$s" .sh); done
4343
cp input/cross.meson input/toolchain.cmake /
4444
EOF
4545

@@ -49,7 +49,7 @@ RUN <<EOF
4949
dnf5 install mingw32-{gcc{,-c++},libgomp}
5050
dnf5 clean all
5151
find /usr/*mingw*/* -type f -name "*.dll*" -delete
52-
rm -rf /tmp/* /usr/share/doc/* /var/cache/* /var/lib/dnf/history.* /var/log/* /var/tmp/*
52+
rm -rf /tmp/* /usr/share/doc/* /usr/i686-w64-mingw32ucrt/sys-root/mingw/share/locale/* /usr/i686-w64-mingw32ucrt/sys-root/mingw/share/man/* /var/cache/* /var/lib/dnf/history.* /var/log/* /var/tmp/*
5353
mkdir /opt/ffbuild
5454
EOF
5555

images/base-win64/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ RUN <<EOF
3939
EOF
4040

4141
RUN --mount=src=.,dst=/input <<EOF
42-
for s in /input/*.sh; do cp $s /usr/bin/$(echo $s | sed -e 's|.*/||' -e 's/\.sh$//'); done
42+
for s in /input/*.sh; do cp "$s" /usr/bin/$(basename "$s" .sh); done
4343
cp input/cross.meson input/toolchain.cmake /
4444
EOF
4545

@@ -49,7 +49,7 @@ RUN <<EOF
4949
dnf5 install ucrt64-{gcc{,-c++},libgomp}
5050
dnf5 clean all
5151
find /usr/*mingw*/* -type f -name "*.dll*" -delete
52-
rm -rf /tmp/* /usr/share/doc/* /var/cache/* /var/lib/dnf/history.* /var/log/* /var/tmp/*
52+
rm -rf /tmp/* /usr/share/doc/* /usr/x86_64-w64-mingw32ucrt/sys-root/mingw/share/locale/* /usr/x86_64-w64-mingw32ucrt/sys-root/mingw/share/man/* /var/cache/* /var/lib/dnf/history.* /var/log/* /var/tmp/*
5353
mkdir /opt/ffbuild
5454
EOF
5555

0 commit comments

Comments
 (0)