This is documented.
I'm confused by how docker-compose
decides to name volumes, prefixing a garbled directory path to the volume name. Consequently if you rename the directory, a new volume is created.
So I wanted to export the volume contents as a .tar.
MOUNT=/usr/share/elasticsearch/data; \
for VOLUME in {mariner,data_parsers_mariner,optdata_parsers_mariner}_elasticsearch_data; do \
sudo docker run --rm -v $VOLUME:$MOUNT -v /data/backup:/backup ubuntu \
tar cvf /backup/$VOLUME.tar $MOUNT; \