Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow miniconda to run as non-root user #536

Open
kimsin98 opened this issue Jul 7, 2023 · 3 comments
Open

Allow miniconda to run as non-root user #536

kimsin98 opened this issue Jul 7, 2023 · 3 comments

Comments

@kimsin98
Copy link

kimsin98 commented Jul 7, 2023

Currently, due to the apt/yum dependency check, --miniconda has to run as root. This can lead to some surprises and inconveniences like #506 (comment) because conda init only runs as root.

If this limitation is not intended, a possible fix is temporarily switching to root for the dependency check.

@kaczmarj
Copy link
Collaborator

thanks @kimsin98 - this limitation is not intended. could you please give an example of a neurodocker command line where this fails?

@Remi-Gau Remi-Gau added the conda label Sep 3, 2023
@kimsin98
Copy link
Author

kimsin98 commented Sep 4, 2023

This would build fine.

docker run --rm repronim/neurodocker:0.7.0 generate docker \
    --base neurodebian:bullseye --pkg-manager apt \
    --user=neuro --workdir /home/neuro \
    --miniconda create_env=neuro activate=true \
                conda_install='jupyter nilearn' \
    > Dockerfile

But after 0.8.0

docker run --rm repronim/neurodocker:0.8.0 generate docker \
    -b neurodebian:bullseye -p apt \
    --user=neuro --workdir /home/neuro \
    --miniconda version=latest env_name=neuro env_exists=false \
                conda_install='jupyter nilearn' \
    > Dockerfile

docker build runs into a permission error because it is not running as root

Step 6/9 : RUN apt-get update -qq     && apt-get install -y -q --no-install-recommends            bzip2            ca-certificates            curl     && rm -rf /var/lib/apt/lists/*     && export PATH="/opt/miniconda-latest/bin:$PATH"     && echo "Downloading Miniconda installer ..."     && conda_installer="/tmp/miniconda.sh"     && curl -fsSL -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh     && bash "$conda_installer" -b -p /opt/miniconda-latest     && rm -f "$conda_installer"     && conda update -yq -nbase conda     && conda config --system --prepend channels conda-forge     && conda config --set channel_priority strict     && conda config --system --set auto_update_conda false     && conda config --system --set show_channel_urls true     && conda init bash     && conda create -y  --name neuro     && conda install -y  --name neuro            "jupyter"            "nilearn"     && sync && conda clean --all --yes && sync     && rm -rf ~/.cache/pip/*
 ---> Running in 2a0cd57132ca
E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)
The command '/bin/sh -c apt-get update -qq     && apt-get install -y -q --no-install-recommends            bzip2            ca-certificates            curl     && rm -rf /var/lib/apt/lists/*     && export PATH="/opt/miniconda-latest/bin:$PATH"     && echo "Downloading Miniconda installer ..."     && conda_installer="/tmp/miniconda.sh"     && curl -fsSL -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh     && bash "$conda_installer" -b -p /opt/miniconda-latest     && rm -f "$conda_installer"     && conda update -yq -nbase conda     && conda config --system --prepend channels conda-forge     && conda config --set channel_priority strict     && conda config --system --set auto_update_conda false     && conda config --system --set show_channel_urls true     && conda init bash     && conda create -y  --name neuro     && conda install -y  --name neuro            "jupyter"            "nilearn"     && sync && conda clean --all --yes && sync     && rm -rf ~/.cache/pip/*' returned a non-zero code: 100

Copy link

github-actions bot commented Nov 4, 2023

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants