nuxsmin / docker-syspass

Docker stuff for running sysPass on Docker
GNU General Public License v3.0
39 stars 21 forks source link

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

Open cairoapcampos opened 2 years ago

cairoapcampos commented 2 years ago

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?