-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from rofrano/add-devcontainer
Added devcontainer support for easy development environment setup
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} |