Create a docker image with mongodb instance preloaded with daa

I would like to create a docker image with mongodb instance with a specific database and specific data in it. Is it possible or do I need to use mongo image to create the container first and only then create the db and load the data on a running container?

What I have tried so far: I have created a dockerfile as follows:

 1. FROM mongo
 2. COPY ./app/dbdata
 3. EXPOSE 27017
 4. CMD ["sh","-c","mongo && use kanjidb && exit"] 
 5. CMD ["mongorestore",  "--db",  "kanjidb", "dbdata", "--host", "mongo:27017"]

The second line copies folder with bson data.

Thank you for your help or hints.

Source: StackOverflow