D
D
DYLAN2020-08-06 11:37:02
Docker
DYLAN, 2020-08-06 11:37:02

Where does Docker store volumes?

Where does Docker store volumes?

For example, we have a docker file in which the service is declared and in the volume we wrote something like:

mysql:
    image: library/mysql:5.6
    ports:
      - "3306:3306"
    volumes:
      - ./mysql/data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: pass
      MYSQL_DATABASE: app
      MYSQL_USER: app
      MYSQL_PASSWORD: pass


In this case, everything is clear, our database is located in ./mysql/data. But where will it be if we declare the service like this:

mysql:
    image: library/mysql:5.6
    ports:
      - "3306:3306"
    volumes:
      - mysql:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: pass
      MYSQL_DATABASE: app
      MYSQL_USER: app
      MYSQL_PASSWORD: pass

volumes:
    mysql:

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2020-08-06
@ermolaev_nikita

/var/lib/docker/volumes/_name_of_volume_

A
Alexey Yakhnenko, 2015-03-03
@ArsenBespalov

It looks like you didn't commit

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question