-
背景
由于2021-2-2左右Postgres官网把support期间外的包做了移动,导致以前的链接下载不了jessie包 -
对应方法
# install latest postgresql-client
COPY ./apt-transport-https.deb /var/lib/apt/
RUN cd /var/lib/apt
&& apt-get update
&& dpkg --force-depends -i apt-transport-https.deb
&& apt-get update
&& apt-get -y install -f --no-install-recommends
&& rm -rf /var/lib/apt/apt-transport-https.deb
RUN set -x;
echo 'deb http://apt-archive.postgresql.org/pub/repos/apt/ jessie-pgdg main' > etc/apt/sources.list.d/pgdg.list
&& export GNUPGHOME="$(mktemp -d)"
&& repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8'
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}"
&& gpg --armor --export "${repokey}" | apt-key add -
&& rm -rf "$GNUPGHOME"
&& apt-get update
&& apt-get install -y postgresql-client
&& rm -rf /var/lib/apt/lists/*