AnswerBun.com

The path to docker's volumes in Ubuntu

Ask Ubuntu Asked by Transcendent on December 7, 2020

I’m both new to Ubuntu and Docker. I cut to the chase, when I create a volume using the sudo docker volume create TEST command, where should I expect to find the TEST volume and its data in my hard drive?

If I want it to be located in another drive, lets say D: (still new to ubuntu not sure if it also applies to linux) drive, what do I have to do?

3 Answers

Looks like it is /var/lib/docker/volumes

Here's what I got:

$ docker volume create TEST 
$ ls /var/lib/docker/volumes
metadata.db  TEST/

Correct answer by theferrit32 on December 7, 2020

Use docker volume inspect TEST (docs), and there will be a key "Mountpoint" with the path to it:

$ docker volume inspect TEST
[
    {
        "CreatedAt": "2020-09-18T10:46:55-07:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/var/lib/docker/volumes/TEST/_data",
        "Name": "TEST",
        "Options": {},
        "Scope": "local"
    }
]

To extract just the path, for example to use in a script:

$ docker volume inspect --format '{{ .Mountpoint }}' TEST
/var/lib/docker/volumes/TEST/_data

Answered by Davor Cubranic on December 7, 2020

If you're working on WSL2 through Docker Desktop for Windows, volumes will be found here:

/var/data/docker-desktop/default/daemon-data

If you are working on actual Ubuntu, then yes, as the above answer said it will be located in

/var/lib/docker/volumes

Answered by hashd on December 7, 2020

Add your own answers!

Related Questions

What is Ubuntu TV?

2  Asked on September 23, 2020 by bruno-pereira

 

Airplane mode gets turned on and stuck after sleep mode

1  Asked on September 20, 2020 by thundr_strike

     

Elementary OS terminal bell in UBUNTU

1  Asked on September 20, 2020 by abhay-patil

     

Opennic Bind Server ubuntu 20.04

0  Asked on September 19, 2020 by jesper

         

User-Friendly Automated File Organization

0  Asked on September 18, 2020 by prinplup

     

Can’t login via lightdm

0  Asked on September 16, 2020 by alexander-belov

         

Trying to install kubuntu and need help

1  Asked on September 13, 2020 by 00wolfspirit

       

Jupyter Note book and Desktop Short cut

0  Asked on September 12, 2020 by enlightenedfunky

   

How to fix ERROR: Service failed to build: OCI runtime create failed

0  Asked on September 11, 2020 by geovani-benita

       

Package not removed: python-swiftclient 3.5.0

1  Asked on September 10, 2020 by hash_includes_what

   

18.04LTS: Most recent restore date not offered

0  Asked on September 5, 2020 by anton

     

system-config-printer failes to launch

0  Asked on August 31, 2020 by yahboiijose

     

I can not install Netcdf Library

1  Asked on August 30, 2020 by chouiba-zahira

 

VS Code keyboard shortcut not working

1  Asked on August 29, 2020 by missing_one

 

Error while Installing Driver

2  Asked on August 28, 2020 by spectra

     

Fingerprint Support for Acer Swift 1

0  Asked on August 28, 2020 by pandasitt

       

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir