Skip to content

Commit 90b4d15

Browse files
committed
fix: cleanup package installs
1 parent 303a2c4 commit 90b4d15

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

Dockerfile-15

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,26 @@ ARG wal_g_release=2.0.1
4141

4242
FROM ubuntu:focal as base
4343

44-
RUN apt update -y && apt install -y \
44+
45+
ENV DEBIAN_FRONTEND=noninteractive \
46+
DEBCONF_NONINTERACTIVE_SEEN=true \
47+
TZ=Etc/UTC
48+
49+
# Pre-configure tzdata before any installations
50+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
51+
echo $TZ > /etc/timezone && \
52+
apt-get update && \
53+
apt-get install -y --no-install-recommends tzdata && \
54+
apt-get install -y \
4555
curl \
4656
gnupg \
4757
lsb-release \
4858
software-properties-common \
4959
wget \
5060
sudo \
5161
git \
52-
&& apt clean
62+
&& apt clean && \
63+
rm -rf /var/lib/apt/lists/*
5364

5465

5566
RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres
@@ -103,12 +114,6 @@ RUN chown -R postgres:postgres /usr/lib/postgresql
103114
RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets
104115

105116

106-
ENV DEBIAN_FRONTEND=noninteractive
107-
RUN apt-get update && \
108-
apt-get install -y --no-install-recommends tzdata && \
109-
ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
110-
dpkg-reconfigure -f noninteractive tzdata
111-
112117
RUN apt-get update && \
113118
apt-get install -y --no-install-recommends \
114119
build-essential \

Dockerfile-16

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,25 @@ ARG wal_g_release=2.0.1
4141

4242
FROM ubuntu:focal as base
4343

44-
RUN apt update -y && apt install -y \
44+
ENV DEBIAN_FRONTEND=noninteractive \
45+
DEBCONF_NONINTERACTIVE_SEEN=true \
46+
TZ=Etc/UTC
47+
48+
# Pre-configure tzdata before any installations
49+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
50+
echo $TZ > /etc/timezone && \
51+
apt-get update && \
52+
apt-get install -y --no-install-recommends tzdata && \
53+
apt-get install -y \
4554
curl \
4655
gnupg \
4756
lsb-release \
4857
software-properties-common \
4958
wget \
5059
sudo \
5160
git \
52-
&& apt clean
61+
&& apt clean && \
62+
rm -rf /var/lib/apt/lists/*
5363

5464

5565
RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres
@@ -102,20 +112,7 @@ RUN chown -R postgres:postgres /usr/lib/postgresql
102112

103113
RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets
104114

105-
106-
ENV DEBIAN_FRONTEND=noninteractive \
107-
DEBCONF_NONINTERACTIVE_SEEN=true \
108-
TZ=Etc/UTC \
109-
TERM=linux
110-
111-
RUN echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections && \
112-
echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections && \
113-
apt-get update && \
114-
apt-get install -y --no-install-recommends tzdata && \
115-
ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
116-
dpkg-reconfigure -f noninteractive tzdata && \
117-
rm -rf /var/lib/apt/lists/*
118-
115+
119116
RUN apt-get update && \
120117
apt-get install -y --no-install-recommends \
121118
build-essential \

0 commit comments

Comments
 (0)