0

How to build postgresql-9.6 image from postgresql-9.6.1.tar.gz using dockerfile?

I tried to create below dockerfile to install postgresql-9.6 on ubuntu. But I am unable to make it a complete image?

FROM ubuntu:16.04
RUN apt-get update && \
apt-get install software-properties-common -y && \
apt-get install wget && \
add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" && \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
apt-get update && \
apt-get install -y postgresql-9.6 postgresql-client-9.6

EXPOSE 5432

So as an alternative I want to create image from tarball

2
  • Show the efforts that you have already tried and ask specific issues that you are facing Commented Sep 27, 2017 at 6:19
  • Pl. check the updated question Commented Sep 27, 2017 at 6:40

1 Answer 1

1

The official Postgres Dockerfile does a build from source on Debian which should be largely portable to Ubuntu.

It will be easier to just use the postgres:9.6 or postgres:9.6.1 image as a seperate container to your application, rather than trying to manage a build heavy, monolithic container yourself.

Sign up to request clarification or add additional context in comments.

3 Comments

The official docker postgres use alpine:3.5 as base image, but I want java image (custom image) as my base image for which ubuntu16.01 is base image
The alpine image is a seperate build, I thought I'd linked the other one...fixed
Thank you Matt, but I want to build a custom postgresql image. Any help will be very much appreciated

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.