diff --git a/.devcontainer.json b/.devcontainer.json index cbf5166..34eb603 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -15,7 +15,7 @@ } }, "features": { - "ghcr.io/devcontainers/features/docker-from-docker:1": { + "ghcr.io/devcontainers/features/docker-in-docker:2": { "version": "latest" } }, diff --git a/src/miniforge/devcontainer-feature.json b/src/miniforge/devcontainer-feature.json index 7121681..b83251e 100644 --- a/src/miniforge/devcontainer-feature.json +++ b/src/miniforge/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "Conda, Mamba (Miniforge)", "id": "miniforge", - "version": "1.0.0", + "version": "1.0.1", "description": "Installs Conda and Mamba package manager and Python3. conda-forge set as the default (and only) channel.", "documentationURL": "https://github.com/rocker-org/devcontainer-features/tree/main/src/miniforge", "options": { diff --git a/src/miniforge/install.sh b/src/miniforge/install.sh index 83219f3..20b50af 100755 --- a/src/miniforge/install.sh +++ b/src/miniforge/install.sh @@ -12,13 +12,13 @@ set -e rm -rf /var/lib/apt/lists/* if conda --version &>/dev/null; then - echo "(!) conda is already installed." - exit 1 + echo "(!) conda is already installed - exiting." + exit 0 fi if mamba --version &>/dev/null; then - echo "(!) mamba is already installed." - exit 1 + echo "(!) mamba is already installed - exiting." + exit 0 fi if [ "$(id -u)" -ne 0 ]; then diff --git a/test/miniforge/mambaforge-existing-conda.sh b/test/miniforge/mambaforge-existing-conda.sh new file mode 100755 index 0000000..be49c69 --- /dev/null +++ b/test/miniforge/mambaforge-existing-conda.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -e + +# shellcheck source=/dev/null +source dev-container-features-test-lib + +# Check that conda is installed +check "conda" conda --version + +# Report result +reportResults diff --git a/test/miniforge/scenarios.json b/test/miniforge/scenarios.json index 9c56440..06103e9 100644 --- a/test/miniforge/scenarios.json +++ b/test/miniforge/scenarios.json @@ -22,5 +22,12 @@ "variant": "Mambaforge-pypy3" } } + }, + "mambaforge-existing-conda": { + "image": "jupyter/base-notebook", + "features":{ + "miniforge": {} + }, + "containerUser": "root" } }