aboutsummaryrefslogtreecommitdiff
path: root/src/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java')
-rw-r--r--src/java/devcontainer-feature.json2
-rwxr-xr-xsrc/java/install.sh12
2 files changed, 11 insertions, 3 deletions
diff --git a/src/java/devcontainer-feature.json b/src/java/devcontainer-feature.json
index 3d8b8d8..7188929 100644
--- a/src/java/devcontainer-feature.json
+++ b/src/java/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "java",
- "version": "1.0.9",
+ "version": "1.0.10",
"name": "Java (via SDKMAN!)",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/java",
"description": "Installs Java, SDKMAN! (if not installed), and needed dependencies.",
diff --git a/src/java/install.sh b/src/java/install.sh
index 838f782..d2f735d 100755
--- a/src/java/install.sh
+++ b/src/java/install.sh
@@ -24,6 +24,9 @@ ADDITIONAL_VERSIONS=${ADDITIONALVERSIONS:-""}
set -e
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
@@ -65,8 +68,10 @@ updaterc() {
apt_get_update()
{
- echo "Running apt-get update..."
- apt-get update -y
+ if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
+ echo "Running apt-get update..."
+ apt-get update -y
+ fi
}
# Checks if packages are installed and installs them if not
@@ -176,4 +181,7 @@ if [[ "${INSTALL_MAVEN}" = "true" ]] && ! mvn --version > /dev/null; then
sdk_install maven latest
fi
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
echo "Done!"