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

Plan B: stay with user root on Mac

parent 5b97df6f
No related branches found
No related tags found
1 merge request!1Feature/macos
...@@ -38,8 +38,6 @@ function startContainer { ...@@ -38,8 +38,6 @@ function startContainer {
else else
start_params=( start_params=(
--hostname ${COMPOSE_PROJECT_NAME}-l3d --hostname ${COMPOSE_PROJECT_NAME}-l3d
--user ${USERID}:${GROUPID}
--group-add ${GROUPIDS// / --group-add }
--env L3DVERSION=${L3DVERSION} --env L3DVERSION=${L3DVERSION}
--env L3DSHELL=${L3DSHELL} --env L3DSHELL=${L3DSHELL}
--env HOME=/home/${USERNAME} --env HOME=/home/${USERNAME}
...@@ -56,16 +54,19 @@ function startContainer { ...@@ -56,16 +54,19 @@ function startContainer {
) )
if [[ ${L3DHOSTOS} != Darwin ]]; then if [[ ${L3DHOSTOS} != Darwin ]]; then
start_params+=( start_params+=(
--user ${USERID}:${GROUPID}
--group-add ${GROUPIDS// / --group-add }
--volume /etc/group:/etc/group:ro --volume /etc/group:/etc/group:ro
--volume /etc/passwd:/etc/passwd:ro --volume /etc/passwd:/etc/passwd:ro
--volume /etc/shadow:/etc/shadow:ro --volume /etc/shadow:/etc/shadow:ro
--volume /etc/sudoers:/etc/sudoers:ro --volume /etc/sudoers:/etc/sudoers:ro
--volume /etc/sudoers.d:/etc/sudoers.d:ro --volume /etc/sudoers.d:/etc/sudoers.d:ro
) )
else # else
start_params+=( # (see #62) Disabled for now.
--volume ${HOMEDIR}/.passwd:/etc/passwd:ro #start_params+=(
) # --volume ${HOMEDIR}/.passwd:/etc/passwd:ro
#)
fi fi
docker run --name ${COMPOSE_PROJECT_NAME}_l3d -dt \ docker run --name ${COMPOSE_PROJECT_NAME}_l3d -dt \
"${start_params[@]}" \ "${start_params[@]}" \
......
...@@ -17,11 +17,13 @@ case "${L3DHOSTOS}" in ...@@ -17,11 +17,13 @@ case "${L3DHOSTOS}" in
else else
# This works on MacOS when coreutils is installed. # This works on MacOS when coreutils is installed.
SCRIPTPATH="$(dirname "$(greadlink -f "$0")")" SCRIPTPATH="$(dirname "$(greadlink -f "$0")")"
L3DDOCKERHOST="$(dirname "$(greadlink -f "/var/run/docker.sock")")/docker.sock" # (see #62) L3DDOCKERHOST="$(dirname "$(greadlink -f "/var/run/docker.sock")")/docker.sock"
fi fi
GROUPID=1 GROUPID=1
# Write a fake passwd file which will later be mounted into containers. # (see #62) Write a fake passwd file which will later be mounted into containers.
echo "${USERNAME}:x:${USERID}:${GROUPID}:${USERNAME},,,:/home/${USERNAME}:${L3DSHELL}" >${HOME}/.passwd # echo "${USERNAME}:x:${USERID}:${GROUPID}:${USERNAME},,,:/home/${USERNAME}:${L3DSHELL}" >${HOME}/.passwd
USERNAME=root
# This variable is used to access the ssh agent on MacOS. # 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} SSHAUTH=${SSHAUTHMAGICPATH}
......
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