Description
Expected Behavior
I built a docker image using this base image which runs a chat self-hosted chat server. You can see the docker repo here. After building the image, a cont-init.d script 50-config
checks the container ENV variables, installs a downloadeed AdonisJS app using NPM, checks the database endpoint and migrates it (if necessary), and then serves the AdonisJS app.
Current Behavior
The container works fine on my unRAID server, but other users, both on unRAID and not, are running into problems where the NPM commands are not being run by the correct uid/gid. The NPM command should be run by base image uid/gid (911/911), however, the 50-config script is reporting the following errors for some users:
npm ERR! code EUIDLOOKUP
npm ERR! lifecycle could not get uid/gid
npm ERR! lifecycle [ 'nobody', 0 ]
npm ERR! lifecycle
npm ERR! Failed to look up the user/group for running scripts.
npm ERR! Try again with a different --user or --group settings, or
npm ERR! run with --unsafe-perm to execute scripts as root.
Container logs report that the uid/gid is 99/100 and the 10-adduser script runs without error.
This errors seems to be related to a conflict between the docker user nobody/users and the container user/group, but I'm not sure why this would be occurring, nor why I am not having the same issue when I build this container, either on unRAID or manually on my Macbook.
Steps to Reproduce
- Build the the docker container using the template in unRAID Community Apps, with a
docker run
command, or withdocker-compose
using the variables listed in the Github repo. - See if the container initialization script
50-config
runs correctly or not.
Environment
OS: unRAID and Ubuntu
CPU architecture: x86_64
How docker service was installed:
This issue been found by a user who installed my docker image via unRAID's Community Apps and by a user who installed it using a docker-compose.yaml.
Command used to create docker container (run/create/compose/screenshot)
docker run --name='ferdi-server' -e 'NODE_ENV'='development' -e 'DB_CONNECTION'='mysql' -e 'DB_HOST'='10.66.0.10' -e 'DB_PORT'='3306' -e 'DB_USER'='ferdi' -e 'DB_PASSWORD'='password' -e 'DB_DATABASE'='adonis' -e 'IS_CREATION_ENABLED'='true' -e 'CONNECT_WITH_FRANZ'='true' -p '3333:80' -v '/mnt/cache/appdata/ferdi-server/recipes':'/usr/src/app/recipes' -v '/mnt/cache/appdata/ferdi-server':'/config' -v '/mnt/cache/appdata/ferdi-server/database':'/usr/src/app/database' 'xthursdayx/ferdi-server-docker'