Config dir ownership mismatch error on windows 1809 container for elasticsearch

Due to some restrictions at my company we are not allowed to use linux based containers. I am therefore creating a windows container based ELK stack. My dockerfile is heavily inspired by diamol/Dockerfile at master · sixeyed/diamol · GitHub

ARG ELASTIC_VERSION="8.4.3"
FROM mcr.microsoft.com/windows/nanoserver:1809 as download
ARG ELASTIC_VERSION
USER ContainerAdministrator
RUN curl -o elasticsearch.zip https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-%ELASTIC_VERSION%-windows-x86_64.zip
RUN tar -xzf elasticsearch.zip

# elasticsearch
FROM openjdk:11-jdk-nanoserver-1809
ARG ELASTIC_VERSION

EXPOSE 9200 9300
ENV ES_HOME="/usr/share/elasticsearch" \
    ES_JAVA_OPTS="-Xms1024m -Xmx1024m"

WORKDIR /usr/share/elasticsearch
COPY --from=download /elasticsearch-${ELASTIC_VERSION}/ .
COPY elasticsearch.yml log4j2.properties config/

USER ContainerAdministrator
CMD ["bin\\elasticsearch.bat"]

I have a very simple elasticsearch.yml
cluster.name: "windowsrocks"
discovery.type: single-node
network.host: 0.0.0.0

When I start the built image it does not give me a password for Kibana. It instead gives me the error:
Aborting auto configuration because of config dir ownership mismatch. Config dir is owned by BUILTIN\Administrators but auto-configuration directory would be owned by User Manager\ContainerAdministrator

I'm a bit stumped as to what I need to do to get this working. The original file is for 6.8.5 and I've been able to get it to work on 7.6.2 but I'd like to update it to the latest version (8.4.3 as of this writing).

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