Malone
Malone

Reputation: 171

Docker (for Windows) does not mount volume

I'm trying to mount a directory with configuration files in my docker-compose.yml.

In my case it is logstash, which tells me the mounted directory is empty. Loading a bash and ls -la in the parent directory shows that the pipeline directory is empty and is owned by root.

One weird thing is, that it worked a few days ago.

docker-compose.yml:

version: '3'
services:
  logstash:
    image: docker.elastic.co/logstash/logstash:5.6.3
    ports:
      - 5000:5000
      - 8989:8989
    volumes:
      - C:/PROJECT_DIR/config/logstash/pipeline/:/usr/share/logstash/pipeline/

Upvotes: 5

Views: 3827

Answers (2)

SAMUEL
SAMUEL

Reputation: 8552

If you changed your system username or password then you need to re-apply the credentials to get the volume mount working.

Image

Upvotes: 0

Malone
Malone

Reputation: 171

I found it better to try around with docker itself, as it gives more feedback

docker run --rm -it -v C:/PROJECT_DIR/config/logstash/pipeline/:/usr/share/logstash/pipeline/ docker.elastic.co/logstash/logstash:5.6.3

From here and some googling I found out I had to reset my shared drives credentials under "Docker for Windows" -> Settings... -> Shared Drives, because I had changed my windows domain user password.

Upvotes: 9

Related Questions