diff options
Diffstat (limited to 'src/anaconda')
-rw-r--r-- | src/anaconda/devcontainer-feature.json | 2 | ||||
-rwxr-xr-x | src/anaconda/install.sh | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/anaconda/devcontainer-feature.json b/src/anaconda/devcontainer-feature.json index e4b753d..d0bc70d 100644 --- a/src/anaconda/devcontainer-feature.json +++ b/src/anaconda/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "anaconda", - "version": "1.0.7", + "version": "1.0.8", "name": "Anaconda", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/anaconda", "options": { diff --git a/src/anaconda/install.sh b/src/anaconda/install.sh index 468fd01..47f3462 100755 --- a/src/anaconda/install.sh +++ b/src/anaconda/install.sh @@ -16,6 +16,9 @@ CONDA_DIR=${CONDA_DIR:-"/usr/local/conda"} set -eux export DEBIAN_FRONTEND=noninteractive +# 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 @@ -64,7 +67,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 -y + 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 } @@ -128,4 +134,7 @@ if [ -f "/etc/bash.bashrc" ]; then echo "${notice_script}" | tee -a /etc/bash.bashrc fi -echo "Done!"
\ No newline at end of file +# Clean up +rm -rf /var/lib/apt/lists/* + +echo "Done!" |