Skip to content

Commit 446dbbf

Browse files
committed
Fixed $HOME variable if using sudo
1 parent 1515f4c commit 446dbbf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

docker/main/entrypoint.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ case "$1" in
4848
cli)
4949
if [ -n "${CLI_SCRIPT}" ]; then
5050
shift
51-
exec sudo -E -u "${CLI_USER}" ${CLI_SCRIPT} "$@"
51+
exec sudo -H -E -u "${CLI_USER}" ${CLI_SCRIPT} "$@"
5252
else
5353
echo "[ERROR] No CLI_SCRIPT in docker-env.yml defined"
5454
exit 1
@@ -57,9 +57,7 @@ case "$1" in
5757

5858
## All other commands
5959
*)
60-
## Set home dir (workaround)
61-
export HOME=/home/
6260
## Execute cmd
63-
exec sudo -E -u "${CLI_USER}" "$@"
61+
exec sudo -H -E -u "${CLI_USER}" "$@"
6462
;;
6563
esac

0 commit comments

Comments
 (0)