I am trying to create a Docker container with MongoDB and import data into it. I have tried using the following dockerfile:
FROM mongo
# This will be created if it doesn't exist
WORKDIR /app/data/
# Copy dependency definitions
COPY mydata.csv .
ENTRYPOINT mongod
# Import data
RUN mongoimport --host=127.0.0.1 -d mydb -c reports --type csv --file mydata.csv --headerline
I get the following error:
Failed: error connecting to the db server: no reachable servers
Any suggestions? Thanks!