JohannesWiesner / csp_docker

A repository for creating Docker and Singularity files using Neurodocker
0 stars 1 forks source link

Update base-image #12

Open JohannesWiesner opened 1 year ago

JohannesWiesner commented 1 year ago

Would be more nice to have a newer base-image but we run into troubles with images like debian-bookworm or newer versions of neurdebian (either we are not being able to install packages with neurodocker using arguments like --fsl version=6.0.4, or we are stuck in user surveys where we cannot set "yes" or "no"). See also these comments.

JohannesWiesner commented 1 year ago

Is the user-survey bug already reported to the neurodocker folks? @Engrammae

JohannesWiesner commented 1 year ago

See within code-comment (that I deleted to put it here):

JohannesWiesner commented 1 year ago

With e2b0b9157a175c8114d17306246a0ea36116a51f I replaced --arg DEBIAN_FRONTEND='noninteractive' with the --yes flag ("reply yes to all prompt questions"). I am not sure what happens if we switch to other base-images and/or add more software-Packages. I guess for now, we just have to try out which combinations of base-images and software-packages lead to "stuck" building processes (e.g. the survey question that happens with FSL) and if it can be solved with --yes or --arg DEBIAN_FRONTEND='noninteractive' (--yes should be the recommended way of handling with this issues because it is an offical option of neurodocker. Actually, the --yes flag could even write ARG DEBIAN_FRONTEND=noninteractive to the Dockerfile, the question is only what happens if the base-image is not a Debian derivate?)

JohannesWiesner commented 1 year ago

Just discovered that the --yes flag actually doesn't seem to do anything? I ran this script with and without it and it doesn't actually seem to have an effect on the Dockerfile?:

# function to create a dockerfile
generate_docker() {
    docker run -i --rm repronim/neurodocker:0.9.4 generate docker \
        --base-image neurodebian:stretch-non-free \
        --yes \
        --pkg-manager apt \
        --install opts="--quiet" \
            gcc \
            g++ \
            octave \
        --spm12 \
            version=r7771 \
        --freesurfer \
            version=7.1.1 \
        --copy $conda_yml_file /tmp/ \
        --miniconda \
            version=latest \
            yaml_file=/tmp/$conda_yml_file \
            env_name=csp \
        --user csp \
        --run 'mkdir /home/csp/data && chmod 777 /home/csp/data && chmod a+s /home/csp/data' \
        --run 'mkdir /home/csp/output && chmod 777 /home/csp/output && chmod a+s /home/csp/output' \
        --run 'mkdir /home/csp/code && chmod 777 /home/csp/code && chmod a+s /home/csp/code' \
        --run 'mkdir /home/csp/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > home/csp/.jupyter/jupyter_notebook_config.py' \
        --workdir /home/csp/code \
        --run 'echo source activate csp >> /home/csp/.bashrc'
}
JohannesWiesner commented 1 year ago

Apparently, I thought --yes would have the same functionality as --arg DEBIAN_FRONTEND='noninteractive' which is not the case. Error should be reproducible when adding FSL again in the script above (we should probably end up with this user survey question again and get stuck in the building process).