postgresql-12 installion problem with ubuntu 18.4 docker image

I was trying to install Postgresql-12 on an ubuntu container but it 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.02 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://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8

RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ 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