Skip to content

How to run the container with a non root user?  #60

@cairoapcampos

Description

@cairoapcampos

I created a custom dockerfile. I want to start the container with a non-root user. However, I still couldn't.

Dockerfile

FROM syspass/syspass:3.2.2

# Create the user in a group of the same name and associate the application directory.
RUN groupadd -g 1000 myuser && useradd -r -m -u 1000 -g myuser myuser

USER myuser

Logs:

mycont  | entrypoint: Starting with UID : 9001
mycont  | useradd: Permission denied.
mycont  | useradd: cannot lock /etc/passwd; try again later.
mycont  | entrypoint: Starting with UID : 9001
mycont  | useradd: Permission denied.
mycont  | useradd: cannot lock /etc/passwd; try again later.
mycont  | entrypoint: Starting with UID : 9001

Could you give me a tip on how to run the container with a non-root user?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions