From c3b7dd8e456fbe8fba1f8a15c4737c4a3f1a7395 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Sun, 28 Apr 2019 06:57:49 -0700 Subject: [PATCH] Tomcat definition tweaks --- .../java-8-tomcat-8.5/.devcontainer/Dockerfile | 4 ++++ .../.devcontainer/settings.vscode.json | 3 +++ containers/java-8-tomcat-8.5/README.md | 15 ++++++++------- 3 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 containers/java-8-tomcat-8.5/.devcontainer/settings.vscode.json diff --git a/containers/java-8-tomcat-8.5/.devcontainer/Dockerfile b/containers/java-8-tomcat-8.5/.devcontainer/Dockerfile index e2275409cd..ba391241a0 100644 --- a/containers/java-8-tomcat-8.5/.devcontainer/Dockerfile +++ b/containers/java-8-tomcat-8.5/.devcontainer/Dockerfile @@ -5,6 +5,10 @@ FROM tomcat:8.5-jre8 +# Copy endpoint specific user settings into container to specify Java path +COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json + + # Configure apt ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update \ diff --git a/containers/java-8-tomcat-8.5/.devcontainer/settings.vscode.json b/containers/java-8-tomcat-8.5/.devcontainer/settings.vscode.json new file mode 100644 index 0000000000..e4faefac85 --- /dev/null +++ b/containers/java-8-tomcat-8.5/.devcontainer/settings.vscode.json @@ -0,0 +1,3 @@ +{ + "java.home": "/docker-java-home" +} \ No newline at end of file diff --git a/containers/java-8-tomcat-8.5/README.md b/containers/java-8-tomcat-8.5/README.md index 4ca7b213f1..f15593eb69 100644 --- a/containers/java-8-tomcat-8.5/README.md +++ b/containers/java-8-tomcat-8.5/README.md @@ -39,13 +39,14 @@ This definition includes some test code that will help you verify it is working 3. Start VS Code, press F1, and select **Remote-Containers: Open Folder in Container...** 4. Select the `containers/java-8-tomcat-8.5` folder. 5. After the folder has opened in the container, press F1, and select **Tomcat: Add Tomcat Server**. -6. In the prompted File Dialog, select `/usr/local/tomcat` and click **OK** button to add a new Tomcat Server. -7. Go to VS Code Terminal viewlet, click **+** button to new a bash terminal, then run the commands below to generate a war file. - ``` - cd test-project - mvn clean package - ``` -8. Find the war file `test-project/target/mywebapp-0.0.1-SNAPSHOT.war`, click the context menu **Debug on Tomcat Server**, then the application will be started in a Tomcat Server. +6. Select `/usr/local/tomcat` as the path and click **OK** to add a new Tomcat Server. +7. Press ctrl+shift+` to open a new terminal, then run the commands below to generate a war file. + ``` + cd test-project + mvn clean package + ``` +8. Navigate to `test-project/target/mywebapp-0.0.1-SNAPSHOT.war` in the explorer, right-click on the file, and select **Debug on Tomcat Server** +9. The application will then start in the Tomcat Server! ## License