1

I followed the following steps to make my a custom image of postgresql database:

docker pull postgresql

Then

makdir postgresql
touch Dockerfile
sudo nano Dockerfile

Edited the docker file to be like below:

FROM ubuntu:14.04
MAINTAINER tenali<[email protected]>
RUN apt-get update
RUN docker pull mdillon/postgis

now when i do

sudo docker build -t gautam/postgresql:v2 .

I get the following error:

/bin/sh: 1: docker: not found

I guess what that's saying is the command docker does't exist in /bin/sh , i guess i am making a mistake in writing the Dockerfile. can you check my Dockerfile and tell me what am i doing wrong ?

2
  • So first, you don't need to run sudo to edit your Dockerfile (in fact, that will likely come back to bite you at some point), and secondly "docker: not found` suggets that you simply do not have docker installed at this time. It has nothing to do with the contents of your Dockerfile. Commented Aug 26, 2015 at 17:30
  • @larsks , if i run docker from the terminal , instead of writing a dockerfile , it runs fine Commented Aug 26, 2015 at 17:33

1 Answer 1

1

Sorry, the formatting of your post meant that I didn't notice your Dockerfile. I fixed that for you. You would not run docker pull inside a Dockerfile. What you probably want is something like:

FROM mdillon/postgis
MAINTAINER tenali<[email protected]>
RUN apt-get update

The FROM directive means, effectively, "pull this image if it doesn't already exist and use it as the base for the image I am creating with this Dockerfile".

It's not clear from your question what the relationship is between the postgresql image and the mdillon/postgis image, or why you're pulling one then using the other.

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

3 Comments

i need my postgreSQL database to be postGIS enabled !! thats why i am pulling mdillon/postgis .. do you think i am going in the right direction as far as enableing my postgresql database is concerned(as i said i need to make it postGIS enabled) ?
According to the description, mdillon/postgis already is a postgis-enabled PostgreSQL installation.
! Danm ! missed that , ok how do i make a postgreSQL database image , postGIS enabled , i need to do this using dockerfile and i can't use mdillon/postgis ... sorry for the confusion

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.