I'm making some docker-compose yml file with this link. In this config, What does meaning of driver: local in top-level volumes?
volumes: esdata1: driver: local esdata2: driver: local
You can use Docker Compose to define your local development environment, including environment variables, ports you need accessible, and volumes to mount. Everything is defined in docker-compose. yml , which is used by the docker-compose CLI.
Volumes are the preferred mechanism for persisting data generated by and used by Docker containers. While bind mounts are dependent on the directory structure and OS of the host machine, volumes are completely managed by Docker.
Named volumes These volumes are created inside /var/lib/docker/volume local host directory.
Docker supports several storage drivers, using a pluggable architecture. The storage driver controls how images and containers are stored and managed on your Docker host. After you have read the storage driver overview, the next step is to choose the best storage driver for your workloads.
It's volume driver, equivalent to
docker volume create --driver local --name esdata1 docker volume create --driver local --name esdata2
local
means the volumes esdata1 and esdata2 are created on the same Docker host where you run your container. By using other Volume plugins, e.g.,
--driver=flocker
you are able to create a volume on a external host and mount it to the local host, say, /data-path
. So, when your container writes to /data-path
, it actually writes to a external disk via network.
Refer here for some sort of Volume plugins available
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With