Skip to content

Commit

Permalink
Change: Use --no-install-recommends for Debian/Ubuntu to reduce image…
Browse files Browse the repository at this point in the history
… size. (#64)
  • Loading branch information
cfi-gb authored Nov 11, 2024
1 parent 78695e8 commit 92fe5ec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion applications/oracle-weblogic/10.3.6.0-2017/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN ( \
if [ $? = 100 ]; then sed -i "s/security\|archive/old-releases/" /etc/apt/sources.list && apt-get update; fi \
) \
&& if [ "$UPDATED" = true ]; then apt-get upgrade -y; fi \
&& apt-get install -y openssh-server \
&& apt-get install --no-install-recommends -y openssh-server \
&& rm -rf /var/lib/apt/lists/* \
&& useradd demo \
&& echo "demo:demo" | chpasswd \
Expand Down
5 changes: 3 additions & 2 deletions operating_systems/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& if [ "$UPDATED" = true ]; then apt-get upgrade -y; fi \
&& if [ $(cut -d "." -f 1 /etc/debian_version) -lt 4 ]; then apt-get install -y ssh; \
else apt-get install -y openssh-server; fi \
elif [ $(cut -d "." -f 1 /etc/debian_version) -eq 4 ]; then apt-get install -y openssh-server; \
else apt-get install --no-install-recommends -y openssh-server; fi \
&& rm -rf /var/lib/apt/lists/* \
&& useradd demo \
&& echo "demo:demo" | chpasswd \
&& mkdir -p /var/run/sshd/

CMD [ "/usr/sbin/sshd", "-D" ]

EXPOSE 22
EXPOSE 22
2 changes: 1 addition & 1 deletion operating_systems/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN ( \
if [ $? = 100 ]; then sed -i "s/security\|archive/old-releases/" /etc/apt/sources.list && apt-get update; fi \
) \
&& if [ "$UPDATED" = true ]; then apt-get upgrade -y; fi \
&& apt-get install -y openssh-server \
&& apt-get install --no-install-recommends -y openssh-server \
&& rm -rf /var/lib/apt/lists/* \
&& useradd demo \
&& echo "demo:demo" | chpasswd \
Expand Down

0 comments on commit 92fe5ec

Please sign in to comment.