diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..1577154 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,36 @@ +# FROM mcr.microsoft.com/devcontainers/java:1-21-bullseye +FROM ubuntu:22.04 + +# Add any tools that are needed beyond Java +RUN apt-get update && \ + apt-get install -y sudo sed vim git make gcc zlib1g-dev zip unzip tree curl wget jq && \ + apt-get autoremove -y && \ + apt-get clean -y + +# Create a user for development +ARG USERNAME=vscode +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +# Create the user with passwordless sudo privileges +RUN groupadd --gid $USER_GID $USERNAME \ + && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash \ + && usermod -aG sudo $USERNAME \ + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME \ + && chown -R $USERNAME:$USERNAME /home/$USERNAME + +WORKDIR /codenet-minerva-code-analyzer + +USER $USERNAME + +# Install Java and Gradle via SDKMan +RUN curl -s "https://get.sdkman.io" | bash + +# This SHELL command is needed to run using `source` +SHELL ["/bin/bash", "-c"] +RUN source "$HOME/.sdkman/bin/sdkman-init.sh" && \ + sdk install java 17.0.12-sem && \ + sdk use java 17.0.12-sem && \ + sdk install gradle 8.9 + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..8845edf --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,44 @@ +// cspell: disable +{ + "name": "CodeAnalyzer", + "dockerFile": "Dockerfile", + "context": "..", + "remoteUser": "vscode", + "workspaceFolder": "/codenet-minerva-code-analyzer", + "workspaceMount": "source=${localWorkspaceFolder},target=/codenet-minerva-code-analyzer,type=bind,consistency=delegated", + "runArgs": ["-h", "codenet"], + "customizations": { + "vscode": { + "settings": { + "markdown-preview-github-styles.colorTheme": "light", + "makefile.extensionOutputFolder": "/tmp", + "cSpell.words": [ + "northstar", + "cyclomatic", + "jgrapht", + "stdlibs" + ], + "files.exclude": { + "**/.git": true, + "**/.DS_Store": true + } + }, + "extensions": [ + "vscjava.vscode-java-pack", + "vscjava.vscode-java-test", + "vscjava.vscode-java-debug", + "vscjava.vscode-gradle", + "donjayamanne.githistory", + "bierner.github-markdown-preview", + "yzhang.markdown-all-in-one", + "hnw.vscode-auto-open-markdown-preview", + "davidanson.vscode-markdownlint", + "bierner.markdown-preview-github-styles", + "streetsidesoftware.code-spell-checker", + "ms-azuretools.vscode-docker" + ] + } + }, + // Install the version of gradle the project uses + "postCreateCommand": "./gradlew" +} \ No newline at end of file