PostgreSQL 12 installion problem with Ubuntu 18.04 docker image

I was trying to install Postgresql-12 on an Ubuntu container, but it is giving the following error.

Reading state information…
E: Unable to locate package postgresql-12
E: Unable to locate package postgresql-client-12

It looks like the Ubuntu 18 container doesn’t support PostgreSQL version 12.
Is there any way I can install postgresl version 12 on Ubuntu 18.04 container?
Any help is appreaciated. The docker file code snippet is given below.

FROM ubuntu:18.04

RUN apt-get update && apt-get install -y gnupg dirmngr

RUN apt-key adv --keyserver hkp:// --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8

RUN echo "deb precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common postgresql-12 postgresql-client-12

Source: Docker Questions