How to Specify Docker Volume Location

(chris miller) #1

HI all-

I’m just getting started with Docker-CE running on Ubuntu 18. Have a few containers up and running a things are going well. In my server I have a 500gb ssd, and a 500gb spin drive. Docker is setup on /var/lib/docker, so all my volumes get created there (which is on the SSD). I’m setting up a graylog logging container using the sample yml file, but I would like the volume to be stored on my spin drive which is mounted at /mnt/data. Can someone help point me in the right direction. Here is the snipet from the yml file that I think needs to be modified:

  # MongoDB:
    image: mongo:3
      - mongo_data:/data/db
    driver: local

(Jochen) #2


You could also use bind mounts instead of Docker volumes:

Anyway, make sure to read for the pros and cons of each storage mechanism.

(system) closed #3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.