I need to build a Docker image containing a pre-populate a database.
For now, I am using the following commands in our Dockerfile:
COPY db-dump.gz /tmp
RUN zcat /tmp/db-dump.gz | mysql
But is there a way to achieve the same result without copying first the (potentially large) dump into the container?
At shell-level, I could pipe the data into the container using something along the lines of (untested):
zcat db-dump.gz | docker exec -i $CID mysql
But I don't know if there is any similar option available in a Dockerfile.