You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using docker-compose for testing with one of containers is postgres. Each time I start compose it takes postgres image and spends some to create container out of it because it runs docker-entrypoint.sh.
So I want to speed it up and create Docker image with empty seed database:
FROM postgres:10.1
ENV POSTGRES_PASSWORD mypassword
ENV POSTGRES_DB shell
RUN docker-entrypoint.sh postgres
ENTRYPOINT ["echo DB shell started"]
However it doesn't work because command RUN docker-entrypoint.sh postgres never exits. How to do it the right way?
The text was updated successfully, but these errors were encountered:
When you RUN docker-entrypoint.sh postgres, you're literally starting up the PostgreSQL server, which expects to run indefinitely.
As to what you're trying to accomplish, see #375 and #319 (comment). You'll need to set PGDATA, and likely run initdb yourself (because docker-entrypoint.sh's initialization code is tailored for starting up a persistent instance of PostgreSQL, as you've discovered).
I'm using docker-compose for testing with one of containers is postgres. Each time I start compose it takes postgres image and spends some to create container out of it because it runs docker-entrypoint.sh.
So I want to speed it up and create Docker image with empty seed database:
ENTRYPOINT ["echo DB shell started"]
However it doesn't work because command RUN docker-entrypoint.sh postgres never exits. How to do it the right way?
The text was updated successfully, but these errors were encountered: