Linking Local MongoDB Data to Dockerized MongoDB container

I am new to docker and I’m trying to hookup my dockerized mongodb to my local and former data directory located in /data/db and then I saw here that The host machine volume directory cannot be under /Users (or ~). So, I moved my previous /data/db to /Users/ComputerName/Docker/Mongo/data/db and chown the directory to ComputerName and changed the permission to 777 and then ran

docker run -p 27017:27017 -v /Users/ComputerName/Docker/Mongo/data/db:/data/db --name mongo -d mongo mongod --smallfiles and I’m still getting this error below:

  • Passing environmental variables when deploying docker to remote host
  • YARN run MR job with DCE (docker container executor) stuck on ACCEPTED
  • how to centralized log file on docker container?
  • Dockercloud service stops immediately after start
  • docker container increase listen queue size beyond 128
  • When insert rows using python psycopg2, docker postgres process is terminated
  • chown: changing ownership of '/data/db/_mdb_catalog.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-0--2573889005034950089.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-0-172311321946494465.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-0-5057819112596801042.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-0-7557672013303810902.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-0-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-10-5057819112596801042.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-11-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-13-5057819112596801042.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-13-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-1437-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-1439-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-1441-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-1443-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-1446-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-1450-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-1452-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-1454-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-1456-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-1459-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-15-5057819112596801042.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-15-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-17-5057819112596801042.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-19-5057819112596801042.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-19-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-2-5057819112596801042.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-2-8264987329754823755.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-2059-8691005967059534031.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-2061-8691005967059534031.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-2063-8691005967059534031.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-2066-8691005967059534031.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-2068-8691005967059534031.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-2070-8691005967059534031.wt': Operation not permitted
    chown: changing ownership of '/data/db/collection-2072-8691005967059534031.wt': Operation not permitted
    

  • Is it possible to limit docker daemon to only buiding images (and not running containers)?
  • Firewall for the container in docker
  • Speeding up docker build for golang vendoring
  • Docker and Java IDE integration
  • Deploy AngularJS app into docker container
  • Cannot connect to remote SQL Server instance from app in container
  • One Solution collect form web for “Linking Local MongoDB Data to Dockerized MongoDB container”

    Did you changed chmod with -R modifier? You can also try to add Yours account name to docker group.
    – usermod -a -G docker

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.