-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Add devcontainer support for plugin development (#54)
* Add devcontainer support for plugin Development * Add devcontainer support for plugin Development
- Loading branch information
1 parent
f11b4ca
commit b821f45
Showing
2 changed files
with
79 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,39 @@ | ||
FROM ubuntu:22.04 | ||
|
||
# Prevent interactive prompts during package installation | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install required packages | ||
RUN apt-get update && apt-get install -y \ | ||
coreutils \ | ||
bash \ | ||
openjdk-17-jdk \ | ||
unzip \ | ||
wget \ | ||
git \ | ||
curl \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Gradle manually | ||
ENV GRADLE_VERSION=8.1 | ||
RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip && \ | ||
unzip gradle-${GRADLE_VERSION}-bin.zip -d /opt && \ | ||
ln -s /opt/gradle-${GRADLE_VERSION}/bin/gradle /usr/local/bin/gradle && \ | ||
rm gradle-${GRADLE_VERSION}-bin.zip | ||
|
||
# Set up environment variables | ||
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 | ||
ENV GRADLE_HOME=/opt/gradle-8.1 | ||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${JAVA_HOME}/bin:${GRADLE_HOME}/bin | ||
|
||
# Create a non-root user | ||
RUN useradd -ms /bin/bash devuser | ||
USER devuser | ||
WORKDIR /workspaces | ||
|
||
# Verify essential commands are in path | ||
SHELL ["/bin/bash", "-c"] | ||
RUN echo $PATH && \ | ||
which sleep && \ | ||
which java && \ | ||
which gradle |
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,40 @@ | ||
{ | ||
"name": "KCL IntelliJ Dev Container", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": "." | ||
}, | ||
"remoteUser": "devuser", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/${localWorkspaceFolderBasename},type=bind", | ||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"vscjava.vscode-java-pack", | ||
"vscjava.vscode-gradle", | ||
"redhat.java", | ||
"vscjava.vscode-maven", | ||
"vscjava.vscode-java-debug", | ||
"vscjava.vscode-java-test" | ||
], | ||
"settings": { | ||
"java.jdt.ls.java.home": "/usr/lib/jvm/java-17-openjdk-amd64", | ||
"java.configuration.runtimes": [ | ||
{ | ||
"name": "JavaSE-17", | ||
"path": "/usr/lib/jvm/java-17-openjdk-amd64", | ||
"default": true | ||
} | ||
], | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"terminal.integrated.defaultProfile.linux": "bash" | ||
} | ||
} | ||
}, | ||
"remoteEnv": { | ||
"JAVA_HOME": "/usr/lib/jvm/java-17-openjdk-amd64", | ||
"GRADLE_HOME": "/opt/gradle-8.1", | ||
"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${JAVA_HOME}/bin:${GRADLE_HOME}/bin:${PATH}" | ||
}, | ||
"postStartCommand": "echo 'Container started successfully'" | ||
} |