Is it possible to mount docker volume to a different filesystem?

I’m mounting a folder from my host machine which has about 20GB of mongodb files. Mongo is unable to start because it says there isn’t enough space. It appears that the volume is being mounted into tmpfs instead of using the hard disk. Is there any way to change the filesystem for a volume?

docker-compose:

  • Why env variables are not created automatically?
  • Docker Alpine image non finding php7.1-xsl
  • Docker - access another container on the same machine via its public ip, without docker links
  • Compose: running a container that exits
  • AWS ECS - Images from S3
  • Docker port binding using gitlab-ci with gitlab-runner
  •     mongo:
        image: mongo:2.4
        volumes:
            - /data/db:/data/db
    

    Docker output

    mongo_1  | Wed May  4 20:55:12.591 [initandlisten] ERROR: Insufficient free space for journal files
    

    Machine memory:

    Filesystem     1K-blocks    Used Available Use% Mounted on
    tmpfs            1025388  241788    783600  24% /data/db
    /dev/vda2       61886452 1128580  57591152   2% /data/configdb
    /dev/vda2       61886452 1128580  57591152   2% /etc/resolv.conf
    /dev/vda2       61886452 1128580  57591152   2% /etc/hostname
    /dev/vda2       61886452 1128580  57591152   2% /etc/hosts
    

  • Accessing Docker-compose containers hostnames from a container
  • DockerHub Webhook trigger Jenkins build
  • Dockerfile; docker build volumes: changes to volume via ADD or COPY are not discarded
  • How does the Docker network feature provide service discovery?
  • Unable to set Docker container hostname via Marathon Json file
  • Run Java command line from node.js dokku container
  • One Solution collect form web for “Is it possible to mount docker volume to a different filesystem?”

    This may be an issue with the Docker beta on your Mac.

    Running Docker on Centos 7.x, I did:

    mkdir ~/data
    docker run --rm -it -v ~/data:/data/db mongo:2.4 bash
    

    From inside the container I then checked

    # df
    

    And got

    ...
    /dev/mapper/vg_root-root 29939424 6139352 23800072 21% /data/db
    ...
    

    As you would expect. It’s not mapped to tmpfs.

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