It’s much simpler than you thought:
docker run -it --rm --mount type=tmpfs,destination=/ramdisk,tmpfs-size=1.5G --mount type=bind,src=Y:\storagenode2\storage\,dst=/data sstc/sqlite3 sh
/data # cp used_serial.db /ramdisk/
/data # sqlite3 /ramdisk/used_serial.db
sqlite> .mode insert
sqlite> .output /ramdisk/dump_all.sql
sqlite> .dump
sqlite> .exit
/data # rm /ramdisk/used_serial.db
/data # cat /ramdisk/dump_all.sql | grep -v TRANSACTION | grep -v ROLLBACK | grep -v COMMIT >/ramdisk/dump_all_notrans.sql
/data # rm /ramdisk/dump_all.sql
/data # sqlite3 /ramdisk/used_serial.db ".read /ramdisk/dump_all_notrans.sql"
/data # mv used_serial.db used_serial.db.bak
/data # cp /ramdisk/used_serial.db used_serial.db
/data # exit