muerwre.github.io/content/Docker/Seed dump inside docker.md
2022-11-04 18:29:11 +06:00

393 B

If you need to seed .sql dump in #docker container, just run this command. Also you can try to rsync file with SSH to get it from remote host.

#####
# usage: ./script.sh "/path/to/dump.sql"
#####

DUMP_PATH=$1
CONTAINER="db"
USER=root
PASSWORD=password
DB=database

cat "$DUMP_PATH" | docker exec -i $CONTAINER mysql -u$USER -p$PASSWORD $DB