Skip to content

Instantly share code, notes, and snippets.

@duduribeiro
Created September 16, 2019 02:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save duduribeiro/2f2515f47d13ca766f0fe213b2feedaa to your computer and use it in GitHub Desktop.
Save duduribeiro/2f2515f47d13ca766f0fe213b2feedaa to your computer and use it in GitHub Desktop.
Dockerfile 2
# dump build stage
FROM postgres:11-alpine as dumper
COPY test_dump.sql /docker-entrypoint-initdb.d/
RUN ["sed", "-i", "s/exec \"$@\"/echo \"skipping...\"/", "/usr/local/bin/docker-entrypoint.sh"]
ENV PG_USER=postgres
ENV PGDATA=/data
RUN ["/usr/local/bin/docker-entrypoint.sh", "postgres"]
# final build stage
FROM postgres:11-alpine
COPY --from=dumper /data $PGDATA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment