@@ -86,6 +86,11 @@ check_packages git sudo wget ca-certificates
8686if ! oryx --version > /dev/null ; then
8787 echo " Installing Oryx..."
8888
89+ if ! cat /etc/group | grep -e " ^oryx:" > /dev/null 2>&1 ; then
90+ groupadd -r oryx
91+ fi
92+ usermod -a -G oryx " ${USERNAME} "
93+
8994 # Install dotnet unless available
9095 if ! dotnet --version > /dev/null ; then
9196 echo " 'dotnet' was not detected. Attempting to install the latest version of the dotnet sdk to build oryx."
@@ -104,7 +109,6 @@ if ! oryx --version > /dev/null ; then
104109 mkdir -p ${BUILD_SCRIPT_GENERATOR}
105110 mkdir -p ${ORYX}
106111
107- chown -R ${USERNAME} ${BUILD_SCRIPT_GENERATOR} ${ORYX}
108112 git clone --depth=1 https://github.com/microsoft/Oryx $GIT_ORYX
109113
110114 $GIT_ORYX /build/buildSln.sh
@@ -118,11 +122,16 @@ if ! oryx --version > /dev/null ; then
118122 ln -s ${BUILD_SCRIPT_GENERATOR} /GenerateBuildScript ${ORYX} /oryx
119123 cp -f $GIT_ORYX /images/build/benv.sh ${ORYX} /benv
120124
121- ORYX_INSTALL_DIR=" /tmp /oryx-platforms"
125+ ORYX_INSTALL_DIR=" /usr/local /oryx-platforms"
122126 mkdir -p " ${ORYX_INSTALL_DIR} "
123- chown -R ${USERNAME} " ${ORYX_INSTALL_DIR} "
124127
125- updaterc " export ORYX_SDK_STORAGE_BASE_URL=https://oryx-cdn.microsoft.io && export ENABLE_DYNAMIC_INSTALL=true && DYNAMIC_INSTALL_ROOT_DIR=$ORYX_INSTALL_DIR "
128+ updaterc " export ORYX_SDK_STORAGE_BASE_URL=https://oryx-cdn.microsoft.io && export ENABLE_DYNAMIC_INSTALL=true && DYNAMIC_INSTALL_ROOT_DIR=$ORYX_INSTALL_DIR && ORYX_PREFER_USER_INSTALLED_SDKS=true"
129+
130+ chown -R :oryx " ${ORYX_INSTALL_DIR} " " ${BUILD_SCRIPT_GENERATOR} " " ${ORYX} "
131+ chmod -R g+r+w " ${ORYX_INSTALL_DIR} " " ${BUILD_SCRIPT_GENERATOR} " " ${ORYX} "
132+ find " ${ORYX_INSTALL_DIR} " -type d | xargs -n 1 chmod g+s
133+ find " ${BUILD_SCRIPT_GENERATOR} " -type d | xargs -n 1 chmod g+s
134+ find " ${ORYX} " -type d | xargs -n 1 chmod g+s
126135fi
127136
128137echo " Done!"
0 commit comments