Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 44db1ac

Browse files
committed
su for nvm
1 parent 25167fb commit 44db1ac

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

containers/codespaces-linux/.devcontainer/base.Dockerfile

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,6 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
6969
&& mkdir -p /usr/local/etc/vscode-dev-containers/ \
7070
&& mv -f /tmp/scripts/first-run-notice.txt /usr/local/etc/vscode-dev-containers/
7171

72-
# Install Python, PHP, Ruby utilities
73-
RUN bash /tmp/scripts/python-debian.sh "none" "/opt/python/latest" "${PIPX_HOME}" "${USERNAME}" "true" \
74-
# Install rvm, rbenv, any missing base gems
75-
&& chown -R ${USERNAME} /opt/ruby/* \
76-
&& bash /tmp/scripts/ruby-debian.sh "none" "${USERNAME}" "true" "true" \
77-
# Link composer
78-
&& ln -s $(which composer.phar) /usr/local/bin/composer \
79-
&& apt-get clean -y
80-
81-
# Install PowerShell
82-
RUN bash /tmp/scripts/powershell-debian.sh \
83-
&& apt-get clean -y
84-
8572
# Setup Node.js, install NVM and NVS
8673
RUN bash /tmp/scripts/node-debian.sh "${NVM_DIR}" "v14.17.6" "${USERNAME}" \
8774
&& (cd ${NVM_DIR} && git remote get-url origin && echo $(git log -n 1 --pretty=format:%H -- .)) > ${NVM_DIR}/.git-remote-and-commit \
@@ -93,11 +80,23 @@ RUN bash /tmp/scripts/node-debian.sh "${NVM_DIR}" "v14.17.6" "${USERNAME}" \
9380
# Set npm global location
9481
&& sudo -u ${USERNAME} npm config set prefix ${NPM_GLOBAL} \
9582
&& npm config -g set prefix ${NPM_GLOBAL} \
96-
&& . ${NVM_DIR}/nvm.sh \
97-
&& nvm use --delete-prefix v14.17.6 --silent \
83+
su ${USERNAME} -c ". $NVM_DIR/nvm.sh && nvm use --delete-prefix v14.17.6 --silent && nvm clear-cache" \
9884
# Clean up
9985
&& rm -rf ${NVM_DIR}/.git ${NVS_HOME}/.git
10086

87+
# Install Python, PHP, Ruby utilities
88+
RUN bash /tmp/scripts/python-debian.sh "none" "/opt/python/latest" "${PIPX_HOME}" "${USERNAME}" "true" \
89+
# Install rvm, rbenv, any missing base gems
90+
&& chown -R ${USERNAME} /opt/ruby/* \
91+
&& bash /tmp/scripts/ruby-debian.sh "none" "${USERNAME}" "true" "true" \
92+
# Link composer
93+
&& ln -s $(which composer.phar) /usr/local/bin/composer \
94+
&& apt-get clean -y
95+
96+
# Install PowerShell
97+
RUN bash /tmp/scripts/powershell-debian.sh \
98+
&& apt-get clean -y
99+
101100
# Install SDKMAN, OpenJDK8 (JDK 11 already present), gradle (maven already present)
102101
RUN bash /tmp/scripts/gradle-debian.sh "latest" "${SDKMAN_DIR}" "${USERNAME}" "true" \
103102
&& su ${USERNAME} -c ". ${SDKMAN_DIR}/bin/sdkman-init.sh \

0 commit comments

Comments
 (0)