0

I'm trying to find out where VOLUME "/shared" is mapped to (Mac) and how to navigate to it on the host machine

I run

docker run -it --volume /shared ubuntu:latest /bin/bash

Then I inspect where it's mapped to:

docker inspect d2e17f3d3bb4

And see the excerpt from the config:

"Mounts": [
    {
        "Type": "volume",
        "Name": "fb7ace0b18153bdad1744f0ac18eadc3775929dd5f448ebb228e7130f86c1a19",
        "Source": "/var/lib/docker/volumes/fb7ace0b18153bdad1744f0ac18eadc3775929dd5f448ebb228e7130f86c1a19/_data",
        "Destination": "/shared",
        "Driver": "local",
        "Mode": "",
        "RW": true,
        "Propagation": ""
    }

And there is not such folder on the host machine:

/var/lib/docker/volumes/fb7ace0b18153bdad1744f0ac18eadc3775929dd5f448ebb228e7130f86c1a19/_data

Not even /var/lib/docker/volumes

/var/lib/docker doesn't exist

Edited:

Thanks to @BMitch

The answer is

  1. Docker VM is located at

~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2

  1. Navigate to the VM

screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

  1. Within the tty one can navigate to /var/lib/docker and docker volumes
Dmitry Dyachkov
  • 1,715
  • 2
  • 19
  • 46

0 Answers0