Skip to content

Instantly share code, notes, and snippets.

@Bharathkumarraju
Forked from duduribeiro/Dockerfile
Created October 1, 2019 03:51
Show Gist options
  • Save Bharathkumarraju/f567cdded818969e4e8fa6fdc7997881 to your computer and use it in GitHub Desktop.
Save Bharathkumarraju/f567cdded818969e4e8fa6fdc7997881 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