aboutsummaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authoreitsupi <50911393+eitsupi@users.noreply.github.com>2022-10-11 01:33:01 +0300
committerGitHub <noreply@github.com>2022-10-11 01:33:01 +0300
commita8cb375d460840bbf8c91599d16fc87d9ee8b996 (patch)
tree73dd647775325582c17a452816457f5cec82004d /src/python
parent065b5ec9e19d4f289a070c3d5337696fd2394dc0 (diff)
Ensure remove apt-update cache at the beginning and end of the scripts (#210)
* remove apt lists * bump versions
Diffstat (limited to 'src/python')
-rw-r--r--src/python/devcontainer-feature.json2
-rwxr-xr-xsrc/python/install.sh15
2 files changed, 12 insertions, 5 deletions
diff --git a/src/python/devcontainer-feature.json b/src/python/devcontainer-feature.json
index 0c90e0b..de65a8c 100644
--- a/src/python/devcontainer-feature.json
+++ b/src/python/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "python",
- "version": "1.0.8",
+ "version": "1.0.9",
"name": "Python",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/python",
"description": "Installs the provided version of Python, as well as PIPX, and other common Python utilities. JupyterLab is conditionally installed with the python feature. Note: May require source code compilation.",
diff --git a/src/python/install.sh b/src/python/install.sh
index 3cf3a88..ac5eec6 100755
--- a/src/python/install.sh
+++ b/src/python/install.sh
@@ -34,6 +34,9 @@ keyserver hkp://keyserver.pgp.com"
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
@@ -199,8 +202,10 @@ oryx_install() {
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
@@ -232,8 +237,7 @@ install_from_source() {
libbz2-dev libreadline-dev libxml2-dev xz-utils libgdbm-dev tk-dev dirmngr \
libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev
if ! type git > /dev/null 2>&1; then
- apt_get_update
- apt-get -y install --no-install-recommends git
+ check_packages git
fi
# Find version using soft match
@@ -454,4 +458,7 @@ if [ "${INSTALL_JUPYTERLAB}" = "true" ]; then
fi
fi
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
echo "Done!"