From 337e07331c9959fba49c53aa5bb17956b6929cb1 Mon Sep 17 00:00:00 2001 From: Heaven31415 Date: Tue, 21 Jan 2020 10:32:19 +0000 Subject: [PATCH 1/6] Fix path in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2741938..b801a7e 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Some things to try: - Press F5 to launch the app in the container. - Once the breakpoint is hit, try hovering over variables, examining locals, and more. 4. **Run a Test:** - - Open `src/main/java/com/mycompany/app/AppTest.java`. + - Open `src/test/java/com/mycompany/app/AppTest.java`. - Put a breakpoint in a test. - Click the `Debug Test` in the Code Lens above the function and watch it hit the breakpoint. From eb41c0cef2116e13fe0c3325b65df31a9d827245 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Thu, 9 Apr 2020 00:34:36 +0000 Subject: [PATCH 2/6] Update with latest definition --- .devcontainer/Dockerfile | 46 ++++++++++++--------------------- .devcontainer/devcontainer.json | 27 +++++++++---------- README.md | 14 +++++----- 3 files changed, 35 insertions(+), 52 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 9f4482a..9718047 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,12 +1,4 @@ -#------------------------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. -#------------------------------------------------------------------------------------------------------------- - -FROM mcr.microsoft.com/java/jdk:8u232-zulu-ubuntu - -# Avoid warnings by switching to noninteractive -ENV DEBIAN_FRONTEND=noninteractive +FROM openjdk:8-jdk # This Dockerfile adds a non-root user with sudo access. Use the "remoteUser" # property in devcontainer.json to use it. On Linux, the container user's GID/UIDs @@ -16,46 +8,40 @@ ARG USERNAME=vscode ARG USER_UID=1000 ARG USER_GID=$USER_UID -# Maven settings ARG MAVEN_VERSION=3.6.3 ARG MAVEN_SHA=c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0 -ENV MAVEN_HOME=/usr/local/share/maven -COPY maven-settings.xml ${MAVEN_HOME}/ref/ -# Configure apt and install packages +COPY maven-settings.xml /usr/share/maven/ref/ +ENV MAVEN_HOME /usr/share/maven +ENV MAVEN_CONFIG /root/.m2 + +# Configure apt +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ # - # Verify git and needed tools are installed - && apt-get -y install \ - git \ - iproute2 \ - procps \ - curl \ - apt-transport-https \ - gnupg2 \ - lsb-release \ - # # Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user. && groupadd --gid $USER_GID $USERNAME \ - && useradd -s /bin/bash --uid ${USER_UID} --gid ${USER_GID} -m $USERNAME \ + && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ # [Optional] Add sudo support for the non-root user && apt-get install -y sudo \ && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\ && chmod 0440 /etc/sudoers.d/$USERNAME \ - # + # + # Verify git, needed tools installed + && apt-get -y install git openssh-client less iproute2 procps curl lsb-release \ + # # Install Maven - && mkdir -p ${MAVEN_HOME} ${MAVEN_HOME}/ref \ + && mkdir -p /usr/share/maven /usr/share/maven/ref \ && curl -fsSL -o /tmp/apache-maven.tar.gz https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz \ && echo "${MAVEN_SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - \ - && tar -xzf /tmp/apache-maven.tar.gz -C ${MAVEN_HOME} --strip-components=1 \ + && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \ && rm -f /tmp/apache-maven.tar.gz \ - && ln -s ${MAVEN_HOME}/bin/mvn /usr/local/bin/mvn \ + && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn \ # # Clean up && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Switch back to dialog for any ad-hoc use of apt-get -ENV DEBIAN_FRONTEND=dialog \ No newline at end of file +ENV DEBIAN_FRONTEND=dialog diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6eca1b6..e2b9c57 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,26 +2,23 @@ "name": "Java Sample", "dockerFile": "Dockerfile", - // Use 'settings' to set *default* container specific settings.json values on container create. - // You can edit these settings after create using File > Preferences > Settings > Remote. + // Set *default* container specific settings.json values on container create. "settings": { "terminal.integrated.shell.linux": "/bin/bash", - "java.home": "/usr/lib/jvm/zulu-8-azure-amd64" + "java.home": "/usr/local/openjdk-8" }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "vscjava.vscode-java-pack" + ], - // Use 'appPort' to create a container with published ports. If the port isn't working, be sure - // your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost. - // "appPort": [], + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], - // Uncomment the next line to run commands after the container is created. + // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "java -version", - // Comment out the next line to run as root - "remoteUser": "vscode", - - // Add the IDs of extensions you want installed when the container is created in the array below. - "extensions": [ - "ms-azuretools.vscode-azurefunctions", - "vscjava.vscode-java-pack" - ] + // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" } \ No newline at end of file diff --git a/README.md b/README.md index b801a7e..855c2f4 100644 --- a/README.md +++ b/README.md @@ -10,18 +10,18 @@ Follow these steps to open this sample in a container: 1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started). -2. To use this repository, you can either open a locally cloned copy of the code: - - - Clone this repository to your local filesystem. - - Press F1 and select the **Remote-Containers: Open Folder in Container...** command. - - Select the cloned copy of this folder, wait for the container to start, and try things out! - - Or open the repository in an isolated Docker volume: +2. To use this repository, you can either open the repository in an isolated Docker volume: - Press F1 and select the **Remote-Containers: Try a Sample...** command. - Choose the "Java" sample, wait for the container to start and try things out! > **Note:** Under the hood, this will use **Remote-Containers: Open Repository in Container...** command to clone the source code in a Docker volume instead of the local filesystem. + Or open a locally cloned copy of the code: + + - Clone this repository to your local filesystem. + - Press F1 and select the **Remote-Containers: Open Folder in Container...** command. + - Select the cloned copy of this folder, wait for the container to start, and try things out! + ## Things to try Once you have this sample opened in a container, you'll be able to work with it like you would locally. From 4498e716a8dc872ca82b0651946d3e7936fb2a4a Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Wed, 8 Apr 2020 17:43:20 -0700 Subject: [PATCH 3/6] Update devcontainer.json --- .devcontainer/devcontainer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e2b9c57..ad6774f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -19,6 +19,6 @@ // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "java -version", - // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. + // Comment out to run as root instead. "remoteUser": "vscode" -} \ No newline at end of file +} From 2b52fca45b94cb37ff7bcb93a0614e4387785049 Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Thu, 30 Jul 2020 23:21:12 +0800 Subject: [PATCH 4/6] Update Dockerfile --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 9718047..c41ba3b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM openjdk:8-jdk +FROM openjdk:11-jdk # This Dockerfile adds a non-root user with sudo access. Use the "remoteUser" # property in devcontainer.json to use it. On Linux, the container user's GID/UIDs From 2a338a105df0b5b834a5ed7d44ddc71d78559715 Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Thu, 30 Jul 2020 23:28:53 +0800 Subject: [PATCH 5/6] Update devcontainer.json --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ad6774f..9eee23b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,7 +5,7 @@ // Set *default* container specific settings.json values on container create. "settings": { "terminal.integrated.shell.linux": "/bin/bash", - "java.home": "/usr/local/openjdk-8" + "java.home": "/usr/local/openjdk-11" }, // Add the IDs of extensions you want installed when the container is created. From 1d5d90dc8848025295ac8133e28d087b5f7fab26 Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Thu, 30 Jul 2020 23:41:22 +0800 Subject: [PATCH 6/6] Update pom.xml --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 39978e7..08e5deb 100644 --- a/pom.xml +++ b/pom.xml @@ -16,9 +16,9 @@ - 1.8 - 1.8 - 1.8 + 11 + 11 + 11