aboutsummaryrefslogtreecommitdiff
path: root/src/php
diff options
context:
space:
mode:
Diffstat (limited to 'src/php')
-rw-r--r--src/php/devcontainer-feature.json2
-rwxr-xr-xsrc/php/install.sh11
2 files changed, 11 insertions, 2 deletions
diff --git a/src/php/devcontainer-feature.json b/src/php/devcontainer-feature.json
index 418162f..294c687 100644
--- a/src/php/devcontainer-feature.json
+++ b/src/php/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "php",
- "version": "1.0.6",
+ "version": "1.0.7",
"name": "PHP",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/php",
"options": {
diff --git a/src/php/install.sh b/src/php/install.sh
index fdc374a..70b63da 100755
--- a/src/php/install.sh
+++ b/src/php/install.sh
@@ -8,6 +8,9 @@
set -eux
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
VERSION=${VERSION:-"latest"}
INSTALL_COMPOSER=${INSTALLCOMPOSER:-"true"}
OVERRIDE_DEFAULT_VERSION=${OVERRIDEDEFAULTVERSION:-"true"}
@@ -73,7 +76,10 @@ updaterc() {
# Checks if packages are installed and installs them if not
check_packages() {
if ! dpkg -s "$@" > /dev/null 2>&1; then
- apt-get update
+ if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
+ echo "Running apt-get update..."
+ apt-get update -y
+ fi
apt-get -y install --no-install-recommends "$@"
fi
}
@@ -222,4 +228,7 @@ chown -R "${USERNAME}:php" "${PHP_DIR}"
chmod -R g+r+w "${PHP_DIR}"
find "${PHP_DIR}" -type d -print0 | xargs -n 1 -0 chmod g+s
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
echo "Done!"