cytopia / devilbox

A modern Docker LAMP stack and MEAN stack for local development
http://devilbox.org
MIT License
4.35k stars 648 forks source link

[Bug]: Cannot run nvm install due to /opt/nvm permissions #978

Open hibernius opened 1 year ago

hibernius commented 1 year ago

Have you already looked into this bug?

(Optional) Error message

mkdir: cannot create directory ‘/opt/nvm/.cache’: Permission denied

What went wrong?

When I run nvm install in the container shell, it fails because of /opt/nvm permissions.

Expected behaviour

I expect for the specified nvm version to be installed.

How can we reproduce the bug?

  1. Connect to container shell
  2. Run nvm install n (where n is any version number)

Host Operating System

Linux

Host Platform (amd64, arm64, other)

amd64

(Linux only) Is SELinux enabled?

Yes, SELinux is enabled

Docker version

Docker version 20.10.23, build 7155243

Docker Compose version

Docker Compose version v2.15.1

Devilbox version

latest master

Have you removed stopped containers before starting?

Yes

Have you pulled latest Docker images before starting?

Yes

Devilbox start command

docker-compose up

Config: .env file

DEBUG_ENTRYPOINT=2
DOCKER_LOGS=0
DEVILBOX_PATH=.
LOCAL_LISTEN_ADDR=
TLD_SUFFIX=dvl.to
EXTRA_HOSTS=
NEW_UID=1000
NEW_GID=1000
TIMEZONE=UTC
DNS_CHECK_TIMEOUT=1
DEVILBOX_UI_SSL_CN=localhost,*.localhost,devilbox,*.devilbox,httpd
DEVILBOX_UI_PROTECT=0
DEVILBOX_UI_PASSWORD=password
DEVILBOX_UI_ENABLE=1
DEVILBOX_VENDOR_PHPMYADMIN_AUTOLOGIN=1
DEVILBOX_VENDOR_PHPPGADMIN_AUTOLOGIN=1
DEVILBOX_HTTPD_MGMT_USER=supervisord
DEVILBOX_HTTPD_MGMT_PASS=mypassword
PHP_SERVER=8.1
HTTPD_FLAVOUR=alpine
HTTPD_SERVER=nginx-stable
MYSQL_SERVER=mariadb-10.6
PGSQL_SERVER=14-alpine
REDIS_SERVER=6.2-alpine
MEMCD_SERVER=1.6-alpine
MONGO_SERVER=5.0
MOUNT_OPTIONS=
HOST_PATH_HTTPD_DATADIR=./data/www
HOST_PATH_BACKUPDIR=./backups
HOST_PATH_SSH_DIR=~/.ssh
PHP_MODULES_ENABLE=
PHP_MODULES_DISABLE=oci8,PDO_OCI,pdo_sqlsrv,sqlsrv,rdkafka,swoole,psr,phalcon
PHP_MAIL_CATCH_ALL=2
HOST_PORT_HTTPD=80
HOST_PORT_HTTPD_SSL=443
HTTPD_HTTP2_ENABLE=1
HTTPD_VHOST_SSL_TYPE=both
HTTPD_DOCROOT_DIR=htdocs
HTTPD_TEMPLATE_DIR=.devilbox
HTTPD_BACKEND_TIMEOUT=180
HTTPD_NGINX_WORKER_PROCESSES=auto
HTTPD_NGINX_WORKER_CONNECTIONS=1024
MYSQL_ROOT_PASSWORD=
HOST_PORT_MYSQL=3306
PGSQL_ROOT_USER=postgres
PGSQL_ROOT_PASSWORD=
PGSQL_HOST_AUTH_METHOD=trust
HOST_PORT_PGSQL=5432
HOST_PORT_REDIS=6379
REDIS_ARGS=
HOST_PORT_MEMCD=11211
HOST_PORT_MONGO=27017
HOST_PORT_BIND=1053
BIND_DNS_RESOLVER=8.8.8.8,8.8.4.4
BIND_DNSSEC_VALIDATE=no
BIND_TTL_TIME=
BIND_REFRESH_TIME=
BIND_RETRY_TIME=
BIND_EXPIRY_TIME=
BIND_MAX_CACHE_TIME=
BIND_LOG_DNS_QUERIES=0

Config: docker-compose.override.yml

No response

Config: ./check-config.sh

# ==============================================================================
# Checking git
# ==============================================================================
[SUCC]  git is clean

# ==============================================================================
# Checking .env file
# ==============================================================================
[SUCC]  .env file exists
[SUCC]  .env file is readable
[SUCC]  All variables are present in .env file
[SUCC]  No variables is duplicated in .env file

# ==============================================================================
# Checking .env file values
# ==============================================================================
[SUCC]  All .env file variables have correct values

# ==============================================================================
# Checking required Devilbox core directories exist
# ==============================================================================
[SUCC]  All PHP cfg/ sub directories are present
[SUCC]  All PHP log/ sub directories are present
[SUCC]  All HTTPD cfg/ sub directories are present
[SUCC]  All HTTPD log/ sub directories are present

# ==============================================================================
# Checking devilbox core directory permissions
# ==============================================================================
[SUCC]  All devilbox directories have correct permissions
[SUCC]  All devilbox directories have correct uid
[SUCC]  All devilbox directories have correct gid

# ==============================================================================
# Checking devilbox core file permissions
# ==============================================================================
[SUCC]  All devilbox files have correct permissions
[SUCC]  All devilbox files have correct uid
[SUCC]  All devilbox files have correct gid

# ==============================================================================
# Checking projects permissions
# ==============================================================================
[SUCC]  All project dirs have correct permissions
[SUCC]  All project dirs have correct uid
[SUCC]  All project dirs have correct gid

# ==============================================================================
# Checking projects settings
# ==============================================================================
[SUCC]  All projects have valid DNS records
[SUCC]  All projects have valid HTTPD_DOCROOT_DIR

# ==============================================================================
# Checking customizations
# ==============================================================================
[INFO]  No custom configurations applied

# ==============================================================================
# SUMMARY
# ==============================================================================
[SUCC]  Found no errors
[INFO]  No custom configurations applied
[INFO]  Ensure to run 'docker-compose stop; docker-compose rm -f' on .env changes or custom configs

Log: docker-compose logs

Couldn't submit bug due to output length. Please specify which portion is required.

(Optional) Additional information

I found issue #499 and see that a fix was released, but the error is occurring regardless. The workaround from that issue thread (sudo chmod -R 777 /opt/nvm) works in this case.

In case it's relevant: the host OS is Windows 10 but Docker is running in WSL2.

Cleancookie commented 10 months ago

I am also seeing the same thing, this is my console output (same thing on the latest PHP container too):

image

wiistriker commented 8 months ago

same for me

alprde commented 5 months ago

type sudo su than hit enter. now try again.