Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker-compose - volumes driver local meaning

Tags:

docker

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 
like image 231
J.Done Avatar asked Feb 13 '17 01:02

J.Done


People also ask

What is docker compose 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.

What does volumes mean in docker compose?

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.

Where are docker volumes stored locally?

Named volumes These volumes are created inside /var/lib/docker/volume local host directory.

What are drivers in docker?

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.


1 Answers

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

like image 166
Rocherlee Avatar answered Sep 28 '22 01:09

Rocherlee