In this section, you will learn how to create a Docker image that contains both PostgreSQL and Go. The image will not be perfect, but it will illustrate how this can be done. As you already know, everything should begin with a Dockerfile, which in this case will be the following:
FROM ubuntu:18.04 RUN apt-get update && apt-get install -y gnupg 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 && apt-get install -y software-properties-common postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3 RUN apt-get update && apt-get install -y git golang vim USER postgres RUN /etc/init.d/postgresql start &&\ ...