Skip to content

Commit 2a7769d

Browse files
authored
chore(Dockerfile): cleanup after installation a bit more than before and keep copyright / license files (#113)
1 parent beb1d32 commit 2a7769d

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

rootfs/Dockerfile

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,25 @@ RUN addgroup --quiet --gid 2000 slug && \
88
RUN sed -i -e 's/^deb-src/#deb-src/' /etc/apt/sources.list && \
99
apt-get update && \
1010
apt-get install -y md5deep && \
11-
apt-get clean && \
12-
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man /usr/share/doc && \
11+
# cleanup
12+
apt-get autoremove -y && \
13+
apt-get clean -y && \
14+
# package up license files if any by appending to existing tar
15+
COPYRIGHT_TAR='/usr/share/copyrights.tar'; \
16+
gunzip $COPYRIGHT_TAR.gz; tar -rf $COPYRIGHT_TAR /usr/share/doc/*/copyright; gzip $COPYRIGHT_TAR && \
17+
rm -rf \
18+
/usr/share/doc \
19+
/usr/share/man \
20+
/usr/share/info \
21+
/usr/share/locale \
22+
/var/lib/apt/lists/* \
23+
/var/log/* \
24+
/var/cache/debconf/* \
25+
/etc/systemd \
26+
/lib/lsb \
27+
/lib/udev \
28+
/usr/lib/x86_64-linux-gnu/gconv/IBM* \
29+
/usr/lib/x86_64-linux-gnu/gconv/EBC* && \
1330
bash -c "mkdir -p /usr/share/man/man{1..8}"
1431

1532
ADD . /

0 commit comments

Comments
 (0)