user3554466
user3554466

Reputation: 31

How import file from computer to docker containers with mongodb

I have a problem with my docker container. I need to import data, something like .csv file from my computer to docker container, but I don't know how. I found a command like "docker insert" but it doesn't work.

Upvotes: 3

Views: 1097

Answers (1)

Cris Holdorph
Cris Holdorph

Reputation: 319

You can do this using Docker volumes.

docker run -i -t -v /home/user/stuff:/data ubuntu /bin/bash

Where in this example /home/user/stuff is a directory OUTSIDE the container and /data is the directory where that content will be located INSIDE the container.

Upvotes: 2

Related Questions