Windows containers: unable to access path.data when using volume mount

Hey,

I've been trying to setup Elasticsearch 6.4.1 on Windows containers. My image is built as follows:

`# Use Nanoserver image
FROM microsoft/nanoserver

# Arguments to make managing versions easier
ARG ELASTICSEARCH_VERSION=6.4.1
ARG ELASTICSEARCH_SOURCE=elasticsearch-${ELASTICSEARCH_VERSION}
ENV ELASTICSEARCH_PATH=elasticsearch-${ELASTICSEARCH_VERSION}

# Copy over Java files
COPY sources /

# Set the JAVA_HOME environment variable
RUN setx -m JAVA_HOME "C:\jdk1.8.0_181"

# Set the default shell as Powershell
SHELL ["powershell.exe", "-Command"]

# Download and extract Elasticsearch
ADD ["https://artifacts.elastic.co/downloads/elasticsearch/${ELASTICSEARCH_SOURCE}.zip", "/"]

RUN Expand-Archive -Path \$($Env:ELASTICSEARCH_SOURCE).zip -DestinationPath \ ; \
Remove-Item -Path \$($Env:ELASTICSEARCH_SOURCE).zip ;

# Elasticsearch config
ENV ELASTIC_HOME C:\\${ELASTICSEARCH_PATH}
COPY elasticsearch.yml ${ELASTIC_HOME}/config/

# Set Java memory limit
ENV ES_JAVA_OPTS -Xms512m -Xmx512m

# Run ElasticSearch
COPY RunElasticSearch.cmd /
CMD ["C:/runelasticsearch.cmd"]

# Expose ElasticSearch ports
EXPOSE 9200 9300`

The image builds fine and Elasticsearch runs fine. However, when I try to use a volume mount to persist data, using the following command (after creating the volume ofcourse),

docker run -v esdata:c:\elasticsearch-6.4.1\data elastic_windows

I get the following error:

`[2018-09-27T15:39:06,072][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Unable to access 'path.data' (C:\elasticsearch-6.4.1\data)`

... And some more stack trace

I'm thinking it has something to do with permissions, but after hours of searching I've been unable to find a solution. Any help would be appreciated. Using Java version: jdk1.8.0._181

Docker info:
    Containers: 6
 Running: 0
 Paused: 0
 Stopped: 6
Images: 91
Server Version: 17.06.2-ee-16
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd json-file logentries splunk syslog
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 14393 (14393.1794.amd64fre.rs1_release.171008-1615)
Operating System: Windows Server 2016 Datacenter
OSType: windows
Architecture: x86_64
CPUs: 8
Total Memory: 3.999GiB
Name: dockerserver
ID: WGXH:PK4G:XIOT:MKH7:SODU:FGNN:IENQ:XW6A:CMUJ:BO6V:RUQE:PTCI
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Elasticsearch.yml config file:
cluster.name: docker-cluster network.host: 0.0.0.0 discovery.zen.minimum_master_nodes: 1 xpack.ml.enabled: false xpack.monitoring.collection.enabled: true

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.