Skip to content

Commit

Permalink
Remove unnecessary apt-get clean in Dockerfile (#9201)
Browse files Browse the repository at this point in the history
This image is built from the official Debian image as upstream, so there
is no need to do apt-get clean manually.

Ref:
- docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get

> Official Debian and Ubuntu images automatically run apt-get clean, so
> explicit invocation is not required.
  • Loading branch information
PeterDaveHello committed Mar 18, 2021
1 parent c8e172e commit ca8b152
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
FROM ubuntu:bionic
LABEL maintainer Brady Wetherington <[email protected]>

# No need to add `apt-get clean` here, reference:
# - https://github.com/snipe/snipe-it/pull/9201
# - https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get

RUN export DEBIAN_FRONTEND=noninteractive; \
export DEBCONF_NONINTERACTIVE_SEEN=true; \
echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
Expand Down Expand Up @@ -37,7 +41,6 @@ libmcrypt-dev \
php7.2-dev \
ca-certificates \
unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*


Expand Down

0 comments on commit ca8b152

Please sign in to comment.