Skip to content

Commit

Permalink
Tweak devcontainer so java and permissions work
Browse files Browse the repository at this point in the history
  • Loading branch information
dsyer committed Sep 27, 2022
1 parent 246f208 commit 777e183
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@ FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}

ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

ARG USER=vscode
VOLUME /home/$USER/.m2
VOLUME /home/$USER/.gradle

ARG JAVA_VERSION=17.0.4.1-ms
RUN sudo mkdir /home/$USER/.m2 /home/$USER/.gradle && sudo chown $USER:$USER /home/$USER/.m2 /home/$USER/.gradle
RUN bash -lc '. /usr/local/sdkman/bin/sdkman-init.sh && sdk install java $JAVA_VERSION && sdk use java $JAVA_VERSION'
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"extensions": [
"vscjava.vscode-java-pack",
"redhat.vscode-xml",
"Pivotal.vscode-boot-dev-pack"
"Pivotal.vscode-boot-dev-pack",
"mhutchie.git-graph"
],
"forwardPorts": [8080],
"settings": {
Expand Down

0 comments on commit 777e183

Please sign in to comment.