Postgres image from docker can't find initdb. What am I missing?

388 Views Asked by At

I'm on windows 10 with docker version 1.9.1 using docker toolbox I wanted to put up a quick postgres container, something I've done before with a dockerfile I had laying around.

FROM postgres

ADD create-db.sql /tmp/
ADD drop_create_table.sql /tmp/
ADD db.sql /tmp/

ADD create-db.sh /docker-entrypoint-initdb.d/

It's pretty simple. and when i run the resulting image. it starts fine. However at the end it says:

...

server started ALTER ROLE

/docker-entrypoint-sh: running

/docker-entrypoint-initdb.d/create-db.sh :No such file or directory

If I try to do docker run -it <imagename> //bin/bash I can see that the file is indeed there:

root@xxxx:/docker-entrypoint-initdb.d# ls

create-db.sh

but whenever I run it it tells me it's not.
The container promptly stops when it doesn't find the file, so I can't try to ssh into the running container.

0

There are 0 best solutions below