energy-quants / mambaforge

Base container with the 'mambaforge' Python distribution installed
MIT License
3 stars 2 forks source link

Ensure `mamba` works with `sudo` #40

Open dhirschfeld opened 2 years ago

dhirschfeld commented 2 years ago

Need to add:

echo 'source /etc/profile.d/conda.sh' >> /root/.bashrc
dhirschfeld commented 2 years ago

Doesn't seem .bashrc is sourced :thinking:

We can instead add the condabin dir to the secure path:

secure_path=$(sudo sed -nr 's|^(Defaults\s+secure_path=".*):?"\s*$|\1:/opt/mambaforge/envs/base/condabin"|p' /etc/sudoers)
echo $secure_path >> /etc/sudoers.d/secure_path