|  | 
| 1 |  | -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | 
| 2 |  | -// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/java | 
| 3 | 1 | { | 
| 4 | 2 |     "name": "Java", | 
| 5 |  | -    "image": "mcr.microsoft.com/vscode/devcontainers/base:bullseye", | 
| 6 |  | - | 
| 7 |  | -    // Configure tool-specific properties. | 
|  | 3 | +    "image": "mcr.microsoft.com/devcontainers/base:debian", | 
| 8 | 4 |     "customizations": { | 
| 9 |  | -        // Configure properties specific to VS Code. | 
| 10 | 5 |         "vscode": { | 
| 11 |  | -            // Set *default* container specific settings.json values on container create. | 
| 12 |  | -            "settings": {  | 
| 13 |  | -            }, | 
| 14 |  | -             | 
| 15 |  | -            // Add the IDs of extensions you want installed when the container is created. | 
| 16 | 6 |             "extensions": [ | 
| 17 | 7 |                 "vscjava.vscode-java-pack", | 
| 18 | 8 |                 "vscjava.vscode-gradle", | 
| 19 |  | -                "shengchen.vscode-checkstyle" | 
|  | 9 | +                "shengchen.vscode-checkstyle", | 
|  | 10 | +                "DavidAnson.vscode-markdownlint" | 
| 20 | 11 |             ] | 
| 21 | 12 |         } | 
| 22 | 13 |     }, | 
| 23 | 14 | 
 | 
| 24 |  | -    "onCreateCommand": "gradle assemble || true", | 
|  | 15 | +    // Source code generation needs to be done before hand-over to VS Code. | 
|  | 16 | +    // Otherwise, the Java extension will go mad. | 
|  | 17 | +    "onCreateCommand": "./gradlew testClasses --console=plain --no-daemon", | 
| 25 | 18 | 
 | 
| 26 |  | -    // Forward the noVNC port (desktop-lite: https://github.com/devcontainers/features/tree/main/src/desktop-lite)   | 
| 27 |  | -    "forwardPorts": [6080], | 
|  | 19 | +    // Forward the vncPort and noVNC port. | 
|  | 20 | +    // They are provided by desktop-lite: | 
|  | 21 | +    // https://github.com/devcontainers/features/tree/main/src/desktop-lite#options | 
|  | 22 | +    "forwardPorts": [5901, 6080], | 
| 28 | 23 | 
 | 
| 29 | 24 |     // Need to connect as root otherwise we run into issues with gradle. | 
| 30 | 25 |     // default option is "vscode". More info: https://aka.ms/vscode-remote/containers/non-root. | 
| 31 | 26 |     "remoteUser": "root", | 
| 32 | 27 |     "features": { | 
| 33 | 28 |         // Adds a lightweight desktop that can be accessed using a VNC viewer or the web | 
| 34 |  | -        "desktop-lite": "latest", | 
|  | 29 | +        "ghcr.io/devcontainers/features/desktop-lite:1": {}, | 
| 35 | 30 | 
 | 
| 36 |  | -        // Install java | 
| 37 |  | -        "java": { | 
| 38 |  | -            "version": "18", | 
| 39 |  | -            "installGradle": true, | 
| 40 |  | -            "jdkDistro": "sem" | 
|  | 31 | +        // Install java. | 
|  | 32 | +        // See https://github.com/devcontainers/features/tree/main/src/java#options for details. | 
|  | 33 | +        "ghcr.io/devcontainers/features/java:1": { | 
|  | 34 | +            "version": "21.0.1-librca", | 
|  | 35 | +            "installGradle": false, | 
|  | 36 | +            "jdkDistro": "librca" | 
| 41 | 37 |         } | 
| 42 | 38 |     } | 
| 43 | 39 | } | 
0 commit comments