aboutsummaryrefslogtreecommitdiff
path: root/src/oryx
diff options
context:
space:
mode:
Diffstat (limited to 'src/oryx')
-rw-r--r--src/oryx/devcontainer-feature.json2
-rwxr-xr-xsrc/oryx/install.sh20
2 files changed, 14 insertions, 8 deletions
diff --git a/src/oryx/devcontainer-feature.json b/src/oryx/devcontainer-feature.json
index 2e40e88..2abf1f2 100644
--- a/src/oryx/devcontainer-feature.json
+++ b/src/oryx/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "oryx",
- "version": "1.0.6",
+ "version": "1.0.7",
"name": "Oryx",
"description": "Installs the oryx CLI",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/oryx",
diff --git a/src/oryx/install.sh b/src/oryx/install.sh
index 826d916..f84cf22 100755
--- a/src/oryx/install.sh
+++ b/src/oryx/install.sh
@@ -12,6 +12,9 @@ MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
set -eu
+# 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
@@ -53,19 +56,17 @@ function 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
check_packages() {
if ! dpkg -s "$@" > /dev/null 2>&1; then
apt_get_update
- DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends "$@"
-
- # Clean up
- apt-get clean -y
- rm -rf /var/lib/apt/lists/*
+ apt-get -y install --no-install-recommends "$@"
fi
}
@@ -105,6 +106,8 @@ fi
# If we don't already have Oryx installed, install it now.
if oryx --version > /dev/null ; then
echo "oryx is already installed. Skipping installation."
+ # Clean up
+ rm -rf /var/lib/apt/lists/*
exit 0
fi
@@ -182,4 +185,7 @@ if [[ "${DOTNET_INSTALLATION_PACKAGE}" != "" ]]; then
apt purge -yq $DOTNET_INSTALLATION_PACKAGE
fi
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
echo "Done!"