Fix groupadd/useradd in `run_docker` so $HOME is set correctly (#2675)

"$HOME is now just set to /. According to useradd's documentation, the flag for setting
the home directory is just --home, not --home-dir. With that, echo $HOME gives the
right result in the container."

https://github.com/pyodide/pyodide/issues/2674#issuecomment-1150182865
This commit is contained in:
Jo Bovy 2022-06-08 19:24:17 +00:00 committed by GitHub
parent 0283a39629
commit e30df9fa9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -127,9 +127,9 @@ CONTAINER=$(\
--shm-size 2g \
"${PYODIDE_DOCKER_IMAGE}" \
/bin/bash -c " \
groupadd '$USER_GID'; \
groupadd --gid '$USER_GID' '$USER_NAME'; \
useradd \
--home-dir '$USER_HOME' \
--home '$USER_HOME' \
--uid '$USER_ID' \
--gid '$USER_GID' \
--comment '$USER_COMMENT_FIELD' \