Skip to content

Commit e9dbce5

Browse files
committed
Update to latest definition
1 parent fef8267 commit e9dbce5

File tree

8 files changed

+22
-465
lines changed

8 files changed

+22
-465
lines changed

.classpath

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<attribute name="test" value="true"/>
1414
</attributes>
1515
</classpathentry>
16-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
16+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
1717
<attributes>
1818
<attribute name="maven.pomderived" value="true"/>
1919
</attributes>

.devcontainer/Dockerfile

+12-35
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,23 @@
1-
# Update the VARIANT arg in devcontainer.json to pick a Java version >= 11
2-
ARG VARIANT=11
3-
FROM openjdk:${VARIANT}-jdk-buster
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.137.0/containers/java/.devcontainer/base.Dockerfile
2+
ARG VARIANT="14"
3+
FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}
44

5-
# Options for setup script
6-
ARG INSTALL_ZSH="true"
7-
ARG UPGRADE_PACKAGES="false"
8-
ARG USERNAME=vscode
9-
ARG USER_UID=1000
10-
ARG USER_GID=$USER_UID
11-
12-
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
13-
COPY library-scripts/*.sh /tmp/library-scripts/
14-
RUN /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
15-
&& if [ ! -d "/docker-java-home" ]; then ln -s "${JAVA_HOME}" /docker-java-home; fi \
16-
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/common-debian.sh
17-
18-
# [Optional] Install Maven
5+
# [Optional] Install Maven or Gradle
196
ARG INSTALL_MAVEN="false"
207
ARG MAVEN_VERSION=3.6.3
21-
ARG MAVEN_DOWNLOAD_SHA="no-check"
22-
ENV MAVEN_HOME=/usr/local/share/maven
23-
RUN if [ "${INSTALL_MAVEN}" = "true" ]; then /bin/bash /tmp/library-scripts/maven-debian.sh ${MAVEN_VERSION} ${MAVEN_HOME} ${USERNAME} ${MAVEN_DOWNLOAD_SHA}; fi \
24-
&& rm -f /tmp/library-scripts/maven-debian.sh
25-
26-
# [Optional] Install Gradle
278
ARG INSTALL_GRADLE="false"
289
ARG GRADLE_VERSION=5.4.1
29-
ARG GRADLE_DOWNLOAD_SHA="no-check"
30-
ENV GRADLE_HOME=/usr/local/share/gradle
31-
RUN if [ "${INSTALL_GRADLE}" = "true" ]; then /bin/bash /tmp/library-scripts/gradle-debian.sh ${GRADLE_VERSION} ${GRADLE_HOME} ${USERNAME} ${GRADLE_DOWNLOAD_SHA}; fi \
32-
&& rm -f /tmp/library-scripts/gradle-debian.sh
10+
RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "source /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi \
11+
&& if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "source /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi
3312

34-
# [Optional] Install Node.js for use with web applications - update the INSTALL_NODE arg in devcontainer.json to enable.
35-
ARG INSTALL_NODE="false"
13+
# [Optional] Install a version of Node.js using nvm for front end dev
14+
ARG INSTALL_NODE="true"
3615
ARG NODE_VERSION="lts/*"
37-
ENV NVM_DIR=/usr/local/share/nvm
38-
ENV NVM_SYMLINK_CURRENT=true \
39-
PATH=${NVM_DIR}/current/bin:${PATH}
40-
COPY library-scripts/node-debian.sh /tmp/library-scripts/
41-
RUN if [ "$INSTALL_NODE" = "true" ]; then /bin/bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}"; fi \
42-
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/node-debian.sh
16+
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
4317

4418
# [Optional] Uncomment this section to install additional OS packages.
4519
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
4620
# && apt-get -y install --no-install-recommends <your-package-list-here>
21+
22+
# [Optional] Uncomment this line to install global node packages.
23+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

.devcontainer/devcontainer.json

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
2-
// https://github.com/microsoft/vscode-dev-containers/tree/v0.134.0/containers/java
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.137.0/containers/java
33
{
44
"name": "Java",
55
"build": {
66
"dockerfile": "Dockerfile",
77
"args": {
8-
// Update the VARIANT arg to pick a Java version >= 11
8+
// Update the VARIANT arg to pick a Java version: 11, 14
99
"VARIANT": "11",
10-
// Options to install Maven or Gradle
10+
// Options
1111
"INSTALL_MAVEN": "true",
12-
"MAVEN_VERSION": "3.6.3",
1312
"INSTALL_GRADLE": "false",
14-
"GRADLE_VERSION": "5.4.1",
1513
"INSTALL_NODE": "false",
1614
"NODE_VERSION": "lts/*"
1715
}
@@ -20,7 +18,8 @@
2018
// Set *default* container specific settings.json values on container create.
2119
"settings": {
2220
"terminal.integrated.shell.linux": "/bin/bash",
23-
"java.home": "/docker-java-home"
21+
"java.home": "/docker-java-home",
22+
"maven.executable.path": "/usr/local/sdkman/candidates/maven/current/bin/mvn"
2423
},
2524

2625
// Add the IDs of extensions you want installed when the container is created.
@@ -34,7 +33,6 @@
3433
// Use 'postCreateCommand' to run commands after the container is created.
3534
// "postCreateCommand": "java -version",
3635

37-
// Comment out the next line to run as root
36+
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
3837
"remoteUser": "vscode"
39-
4038
}

.devcontainer/library-scripts/common-debian.sh

-171
This file was deleted.

.devcontainer/library-scripts/gradle-debian.sh

-70
This file was deleted.

0 commit comments

Comments
 (0)