I wanted to use external directory as volume and struggling
mariadb:
image: mariadb:10.4
...
environment:
..
logging:
...
networks:
- backend
restart: on-failure
volumes:
- maria_volume:/var/lib/mysql
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci
# Volumes
volumes:
maria_volume:
what does maria_volume: mean?
Reference: https://www.cloudytuts.com/tutorials/docker/how-to-add-persistent-data-to-mysql-with-docker-compose/
Ideally I want something like
volumes:
maria_volume:
external:
name: ${PWD}/mariadb
But it gives error
Volume C:/some/test/mariadb declared as external, but could not be found. Please create the volume manually using
docker volume create --name=C:/some/test/mariadb
and try again.
If I run the volume create, it complains
includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]"
How can I create external volume and see data files?
My environment is Windows10 with Gitbash. But I am looking for a solution that works anywhere i.e. my local + cloud