newBike
newBike

Reputation: 15022

docker compose won't mount the external volume

I mount my folder /workspace/ap_news/esdata to elastic_search container, however, I cound't see any created index/ files on the host(mac os) folder.

The created indexes by elastic search only saved in the container.

It couldn't be accessed on my host os(Mac OS)

compose.yml

elasticsearch:
  image: elasticsearch:1.7.1
  hostname: elasticsearch
  ports:
    - "9200:9200"
    - "9300:9300"
  volumes:
    - /workspace/ap_news/esdata:/usr/share/elasticsearch/data

update

I've already mount the host folder to virtualbox

enter image description here

Upvotes: 0

Views: 909

Answers (1)

VonC
VonC

Reputation: 1328342

If you are using a boot2docker VM (even with docker machine), make sure your host local folder is mounted first on that VM.

By default, a boot2docker (Tinycore-based) VM will mount only /Users, nothing else.

Ssh to that vm (docker machine ssh default, for instance) and do:

mount -t vboxsf -o uid=1000,gid=50 your-other-share-name /workspace/ap_news/esdata

Upvotes: 1

Related Questions