Skip to content

Running container as different user fails with permission denied error #182

@irfadrazick

Description

@irfadrazick
  • Version: coderaiser/cloudcmd:10.4.1
  • Node Version: v10.6.0
  • OS: Linux infosak 4.4.0-127-generic #153-Ubuntu SMP Sat May 19 10:58:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • Browser name/version: Chrome/67
  • Used Command Line Parameters: docker run --name cloudcmd -u 10000 -p 8000:8000 -v /var/www:/var/www -v /var/log:/var/log coderaiser/cloudcmd:10.4.1
  • Changed Config: Using different user to run container

When I use different user other than default root to launch a container I am unable to get it started as it tries to switch to /root directory and gets permission denied.

docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "chdir to cwd (\"/root\") set in config.json failed: permission denied": unknown.

I have a use case where I allow access to file which has sensitive information only to web user www-data where other users cannot view that file, hence it makes sense to run the container as different user.

In the Dockerfile I see WORKDIR is changed to /root. Removing the line should fix this problem.

WORKDIR /root

Please kindly check and do the needful.

Thank you

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions