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

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

Open
cairoapcampos opened this issue Feb 23, 2022 · 1 comment
Open

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

cairoapcampos opened this issue Feb 23, 2022 · 1 comment

Comments

@cairoapcampos
Copy link

I'm trying to create a GestióIP container run by a non-root user. I still haven't been successful in creating this container.

I wanted to know how to create a container in the best way. Could you give me a hint on how to do this?

@cairoapcampos
Copy link
Author

cairoapcampos commented Feb 23, 2022

#My dockerfile:

FROM gestioip/gestioip:3570

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

RUN chown -R myuser:myuser /var/www/html
RUN chmod 755 -R /var/www/html

USER myuser

#Logs:

gip          | usermod: Permission denied.
gip          | usermod: cannot lock /etc/passwd; try again later.
gip          | /bin/sed: couldn't open temporary file /etc/xinetd.d/sedE4Jhnd: Permission denied
gip          |  * Stopping internet superserver xinetd
gip          |    ...done.
gip          |  * Starting internet superserver xinetd
gip          |    ...done.
gip          | System has not been booted with systemd as init system (PID 1). Can't operate.
gip          | Failed to connect to bus: Host is down
gip          | Synchronizing state of vsftpd.service with SysV service script with /lib/systemd/systemd-sysv-install.
gip          | Executing: /lib/systemd/systemd-sysv-install disable vsftpd
gip          | update-rc.d: error: Permission denied
gip          | chown: changing ownership of '/usr/share/gestioip/etc/apache/apache-groups': Operation not permitted
gip          | chown: changing ownership of '/usr/share/gestioip/etc/apache/users-gestioip': Operation not permitted
gip          | chown: changing ownership of '/usr/share/gestioip/etc/apache/apache_ldap_require.conf': Operation not permitted
gip          | chown: changing ownership of '/usr/share/gestioip/etc/apache/apache_ldap.conf': Operation not permitted
gip          | chown: changing ownership of '/usr/share/gestioip/etc/apache': Operation not permitted
gip          | touch: cannot touch '.initialized': Permission denied
gip          |  * Starting enhanced syslogd rsyslogd
gip          | mknod: /dev/xconsole: Permission denied
gip          | chown: cannot access '/dev/xconsole': No such file or directory
gip          | rsyslogd: error writing pid file (creation stage)
gip          | : Permission denied
gip          | rsyslogd: run failed with error -3000 (see rsyslog.h or try https://www.rsyslog.com/e/3000 to learn what that number means)
gip          | rsyslog startup failure: error reading "fork pipe": No such process
gip          |    ...done.
gip          |  * Starting periodic command scheduler cron
gip          | cron: can't open or create /var/run/crond.pid: Permission denied
gip          |    ...fail!
gip          | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.20.0.2. Set the 'ServerName' directive globally to suppress this message
gip          | (13)Permission denied: AH00091: apache2: could not open error log file /var/log/apache2/error.log.
gip          | AH00015: Unable to open logs
gip          | Action '-D FOREGROUND' failed.
gip          | The Apache error log may have more information.
gip          | usermod: Permission denied.
gip          | usermod: cannot lock /etc/passwd; try again later.

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

1 participant