Answer the question
In order to leave comments, you need to log in
Docker: how to change the default address of a named volume?
At the root of the project is the docker-compose.yum file :
version: '3.5'
services:
db:
container_name: my_db
image: mysql
ports:
- "3306:3306"
volumes:
- "mysql:/var/lib/mysql"
environment:
MYSQL_ROOT_PASSWORD: 12345
MYSQL_DATABASE: test
MYSQL_USER: vlad
MYSQL_PASSWORD: 12345
volumes:
mysql:
Answer the question
In order to leave comments, you need to log in
Have you tried specifying volumes like this:
volumes:
- "/home/vlad/my_project/mysql:/var/lib/mysql"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question