Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run in docker as root user. #31

Open
henrikstromberg opened this issue Jun 30, 2020 · 3 comments
Open

Unable to run in docker as root user. #31

henrikstromberg opened this issue Jun 30, 2020 · 3 comments

Comments

@henrikstromberg
Copy link

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
Copy link

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
Copy link

nickduch commented Jan 6, 2022

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
Copy link

chrrie commented Jan 14, 2022

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 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants