Docker volumes and overlay path on system partition?

  • I was about to install a postgres in docker and wondered where my data would be stored. Postgres docker defaults to put it on the docker volume, so they would end up on the systems drive. I noticed that the docker overlay folders /var/lib/docker/... are on my OMV installation partition (and HDD).


    I wondered if this makes sense or wouldn't be the volumes and overlays rather considered data for the storage dirve than system?

  • You can change docker folder and use a shared folder of your choice in docker OMV plugin.


    By default, your data will not be saved.
    If you create a volume and use it for postgres it will store data in /var/lib/docker of your host OR in sharedFolderOfYourChoice (if you configure the plugin to change default docker folder)


    What you sould do:


    Bind mounts (also called volumes sometimes)-> Map an OMV host folder from your data drive to the container.


    "The -v /my/own/datadir:/var/lib/postgresql/data part of the command mounts the /my/own/datadir directory from the underlying host system as /var/lib/postgresql/data inside the container, where PostgreSQL by default will write its data files."


    Just read postgres docker image documentation: https://hub.docker.com/_/postgres

  • I am aware how to change docker container paths using the -v option.


    I was just wondering whether it would be more sensible in to have the internal container files rather on the storage data drives than on the OMV systems partition by default.

  • Mine are all on a data drive because the system drive is small.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!