elastic / elasticsearch-net-abstractions

Auxiliary tooling for elastic/elasticsearch-net that does not benefit from the rigorous version branching of that repository
Apache License 2.0
25 stars 14 forks source link

Unable to run in docker as root user. #31

Open henrikstromberg opened 4 years ago

henrikstromberg commented 4 years ago

I need to run the elastic as root user in my docker container. I know that elastic recoment not to do that but is there a way to set it up ?

Kaveh360 commented 3 years ago

Since all bitbucket-pipeline containers runs as root user it might be a good option to be able to set ES to run as root user. This can be a really handy option.

nickduch commented 2 years ago

Sorry for piggy backing here, but is there any known workaround or recommended method for this? I am also trying to run integration tests from within a docker container and I'm getting blocked by this issue.

chrrie commented 2 years ago

I hit the same issue in gitlab and was able to come around it. The problem was made worse by the fact that the gitlab-runner checks out the code as root so dotnet test crashed on source code file permission issues long before elasticsearch was started.

The following works for me (tm)

  image:
    name: mcr.microsoft.com/dotnet/sdk:5.0-buster-slim
  script:
    - adduser --disabled-password --gecos '' dotnetuser
    - umask 0000
    - chmod -R 777 $CI_PROJECT_DIR
    - cp -r $CI_PROJECT_DIR /tmp
    - chown -R dotnetuser /tmp  
    - su -l dotnetuser -c "dotnet test /tmp/MySolution.sln"

(@nickduch )