Skip to content
Snippets Groups Projects
Commit 33506700 authored by jurgenhaas's avatar jurgenhaas
Browse files

Properly mount the user home directory

Also mount the passwd'ish files into the container
parent 6fc4670f
No related branches found
No related tags found
1 merge request!1Feature/macos
......@@ -47,18 +47,18 @@ function startContainer {
--volume /var/run/docker.sock:/var/run/docker.sock
--volume ${WORKDIR}:/drupal
--volume ${SSHAUTH}:${SSHAUTHSOCK}
--volume ${HOMEDIR}:${HOMEDIR}
--volume ${HOMEDIR}:/home/${USERNAME}
--volume /etc/group:/etc/group:ro
--volume /etc/passwd:/etc/passwd:ro
--volume /etc/shadow:/etc/shadow:ro
--volume /etc/sudoers:/etc/sudoers:ro
--volume /etc/sudoers.d:/etc/sudoers.d:ro
--workdir /drupal
--restart unless-stopped
)
if [[ ${L3DHOSTOS} != Darwin ]]; then
start_params+=(
--user ${USERID}:${GROUPID}
--volume /etc/group:/etc/group:ro
--volume /etc/passwd:/etc/passwd:ro
--volume /etc/shadow:/etc/shadow:ro
--volume /etc/sudoers:/etc/sudoers:ro
--volume /etc/sudoers.d:/etc/sudoers.d:ro
)
fi
docker run --name ${COMPOSE_PROJECT_NAME}_l3d -dt \
......
......@@ -14,7 +14,7 @@ case "${L3DHOSTOS}" in
SCRIPTPATH="$(dirname "$(greadlink -f "$0")")"
fi
# This variable is used to access the ssh agent on MacOS.
SSHAUTHMAGICPATH="/run/host-services/ssh-auth.sock"
SSHAUTHMAGICPATH="/run/host-services/ssh-auth.sock"
SSHAUTH=${SSHAUTHMAGICPATH}
SSHAUTHSOCK=${SSHAUTHMAGICPATH}
if [[ $? > 0 ]]; then
......@@ -71,9 +71,13 @@ fi
# Create project container parameters
export USERID=$(id -u)
export USERNAME=${USER}
export GROUPID=$(id -g)
export GROUPIDS=$(id -G)
project_params=(
--env USERID=${USERID}
--env USERNAME=${USERNAME}
--env GROUPID=${GROUPID}
--env GROUPIDS="${GROUPIDS}"
--env HOMEDIR=${HOME}
--env L3DSHELL=${L3DSHELL}
......@@ -84,12 +88,6 @@ project_params=(
--env COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME}
--env COMPOSER_DOWNGRADE=${COMPOSER_DOWNGRADE}
)
if [[ ${L3DHOSTOS} != Darwin ]]; then
project_params+=(
--env USERID=${USERID}
--env GROUPID=${GROUPID}
)
fi
# Execute project container
docker exec -it \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment