question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AFNI docker build fails

See original GitHub issue
neurodocker generate docker \
    --pkg-manager apt \
    --base-image debian:buster-slim \
    --afni method=binaries version=latest \
> afni-binaries.Dockerfile

This command successfully generated the dockerfile Here is the dockerfile

# Generated by Neurodocker and Reproenv.

FROM debian:buster-slim
ENV PATH="/opt/afni-latest:$PATH" \
    AFNI_PLUGINPATH="/opt/afni-latest"
RUN apt-get update -qq \
    && apt-get install -y -q --no-install-recommends \
           ca-certificates \
           cmake \
           curl \
           ed \
           gsl-bin \
           libcurl4-openssl-dev \
           libgl1-mesa-dri \
           libglib2.0-0 \
           libglu1-mesa-dev \
           libglw1-mesa \
           libgomp1 \
           libjpeg-turbo8-dev \
           libjpeg62 \
           libssl-dev \
           libudunits2-dev \
           libxm4 \
           multiarch-support \
           netpbm \
           python-is-python3 \
           python3-pip \
           tcsh \
           xfonts-base \
           xvfb \
    && rm -rf /var/lib/apt/lists/* \
    && _reproenv_tmppath="$(mktemp -t tmp.XXXXXXXXXX.deb)" \
    && curl -fsSL --retry 5 -o "${_reproenv_tmppath}" http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb \
    && apt-get install --yes -q "${_reproenv_tmppath}" \
    && rm "${_reproenv_tmppath}" \
    && _reproenv_tmppath="$(mktemp -t tmp.XXXXXXXXXX.deb)" \
    && curl -fsSL --retry 5 -o "${_reproenv_tmppath}" http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb \
    && apt-get install --yes -q "${_reproenv_tmppath}" \
    && rm "${_reproenv_tmppath}" \
    && apt-get update -qq \
    && apt-get install --yes --quiet --fix-missing \
    && rm -rf /var/lib/apt/lists/* \
    &&  \
    && gsl_path="$(find / -name 'libgsl.so.??' || printf '')" \
    && if [ -n "$gsl_path" ]; then \
         ln -sfv "$gsl_path" "$(dirname $gsl_path)/libgsl.so.0"; \
    fi \
    && ldconfig \
    && mkdir -p /opt/afni-latest \
    && echo "Downloading AFNI ..." \
    && curl -fL https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz \
    | tar -xz -C /opt/afni-latest --strip-components 1

# Save specification to JSON.
RUN printf '{ \
  "pkg_manager": "apt", \
  "existing_users": [ \
    "root" \
  ], \
  "instructions": [ \
    { \
      "name": "from_", \
      "kwds": { \
        "base_image": "debian:buster-slim" \
      } \
    }, \
    { \
      "name": "env", \
      "kwds": { \
        "PATH": "/opt/afni-latest:$PATH", \
        "AFNI_PLUGINPATH": "/opt/afni-latest" \
      } \
    }, \
    { \
      "name": "run", \
      "kwds": { \
        "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n    ca-certificates \\\\\\n    cmake \\\\\\n    curl \\\\\\n    ed \\\\\\n    gsl-bin \\\\\\n    libcurl4-openssl-dev \\\\\\n    libgl1-mesa-dri \\\\\\n    libglib2.0-0 \\\\\\n    libglu1-mesa-dev \\\\\\n    libglw1-mesa \\\\\\n    libgomp1 \\\\\\n    libjpeg-turbo8-dev \\\\\\n    libjpeg62 \\\\\\n    libssl-dev \\\\\\n    libudunits2-dev \\\\\\n    libxm4 \\\\\\n    multiarch-support \\\\\\n    netpbm \\\\\\n    python-is-python3 \\\\\\n    python3-pip \\\\\\n    tcsh \\\\\\n    xfonts-base \\\\\\n    xvfb\\nrm -rf /var/lib/apt/lists/*\\n_reproenv_tmppath=\\"$\(mktemp -t tmp.XXXXXXXXXX.deb\)\\"\\ncurl -fsSL --retry 5 -o \\"${_reproenv_tmppath}\\" http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb\\napt-get install --yes -q \\"${_reproenv_tmppath}\\"\\nrm \\"${_reproenv_tmppath}\\"\\n_reproenv_tmppath=\\"$\(mktemp -t tmp.XXXXXXXXXX.deb\)\\"\\ncurl -fsSL --retry 5 -o \\"${_reproenv_tmppath}\\" http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%%2Bdeb7u2_amd64.deb\\napt-get install --yes -q \\"${_reproenv_tmppath}\\"\\nrm \\"${_reproenv_tmppath}\\"\\napt-get update -qq\\napt-get install --yes --quiet --fix-missing\\nrm -rf /var/lib/apt/lists/*\\n\\ngsl_path=\\"$\(find / -name '"'"'libgsl.so.??'"'"' || printf '"'"''"'"'\)\\"\\nif [ -n \\"$gsl_path\\" ]; then \\\\\\n  ln -sfv \\"$gsl_path\\" \\"$\(dirname $gsl_path\)/libgsl.so.0\\"; \\\\\\nfi\\nldconfig\\nmkdir -p /opt/afni-latest\\necho \\"Downloading AFNI ...\\"\\ncurl -fL https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz \\\\\\n| tar -xz -C /opt/afni-latest --strip-components 1" \
      } \
    } \
  ] \
}' > /.reproenv.json
# End saving to specification to JSON.

docker build --tag afni:latest --file afni-binaries.Dockerfile . This commad fails with the below error

[+] Building 3.3s (5/6)
 => [internal] load build definition from afni-binaries.Dockerfile                                                 0.0s
 => => transferring dockerfile: 4.34kB                                                                             0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 2B                                                                                    0.0s
 => [internal] load metadata for docker.io/library/debian:buster-slim                                              2.6s
 => CACHED [1/3] FROM docker.io/library/debian:buster-slim@sha256:5dbce817ee72802025a38a388237b0ea576aa164bc90b71  0.0s
 => ERROR [2/3] RUN apt-get update -qq     && apt-get install -y -q --no-install-recommends            ca-certifi  0.5s
------
 > [2/3] RUN apt-get update -qq     && apt-get install -y -q --no-install-recommends            ca-certificates            cmake            curl            ed            gsl-bin            libcurl4-openssl-dev            libgl1-mesa-dri            libglib2.0-0            libglu1-mesa-dev            libglw1-mesa            libgomp1            libjpeg-turbo8-dev            libjpeg62            libssl-dev            libudunits2-dev            libxm4            multiarch-support            netpbm            python-is-python3            python3-pip            tcsh            xfonts-base            xvfb     && rm -rf /var/lib/apt/lists/*     && _reproenv_tmppath="$(mktemp -t tmp.XXXXXXXXXX.deb)"     && curl -fsSL --retry 5 -o "${_reproenv_tmppath}" http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb     && apt-get install --yes -q "${_reproenv_tmppath}"     && rm "${_reproenv_tmppath}"     && _reproenv_tmppath="$(mktemp -t tmp.XXXXXXXXXX.deb)"     && curl -fsSL --retry 5 -o "${_reproenv_tmppath}" http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb     && apt-get install --yes -q "${_reproenv_tmppath}"     && rm "${_reproenv_tmppath}"     && apt-get update -qq     && apt-get install --yes --quiet --fix-missing     && rm -rf /var/lib/apt/lists/*     &&      && gsl_path="$(find / -name 'libgsl.so.??' || printf '')"     && if [ -n "$gsl_path" ]; then          ln -sfv "$gsl_path" "$(dirname $gsl_path)/libgsl.so.0";     fi     && ldconfig     && mkdir -p /opt/afni-latest     && echo "Downloading AFNI ..."     && curl -fL https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz     | tar -xz -C /opt/afni-latest --strip-components 1:
#5 0.495 /bin/sh: 1: Syntax error: "&&" unexpected
------
executor failed running [/bin/sh -c apt-get update -qq     && apt-get install -y -q --no-install-recommends            ca-certificates            cmake            curl            ed            gsl-bin            libcurl4-openssl-dev            libgl1-mesa-dri            libglib2.0-0            libglu1-mesa-dev            libglw1-mesa            libgomp1            libjpeg-turbo8-dev            libjpeg62            libssl-dev            libudunits2-dev            libxm4            multiarch-support            netpbm            python-is-python3            python3-pip            tcsh            xfonts-base            xvfb     && rm -rf /var/lib/apt/lists/*     && _reproenv_tmppath="$(mktemp -t tmp.XXXXXXXXXX.deb)"     && curl -fsSL --retry 5 -o "${_reproenv_tmppath}" http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb     && apt-get install --yes -q "${_reproenv_tmppath}"     && rm "${_reproenv_tmppath}"     && _reproenv_tmppath="$(mktemp -t tmp.XXXXXXXXXX.deb)"     && curl -fsSL --retry 5 -o "${_reproenv_tmppath}" http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb     && apt-get install --yes -q "${_reproenv_tmppath}"     && rm "${_reproenv_tmppath}"     && apt-get update -qq     && apt-get install --yes --quiet --fix-missing     && rm -rf /var/lib/apt/lists/*     &&      && gsl_path="$(find / -name 'libgsl.so.??' || printf '')"     && if [ -n "$gsl_path" ]; then          ln -sfv "$gsl_path" "$(dirname $gsl_path)/libgsl.so.0";     fi     && ldconfig     && mkdir -p /opt/afni-latest     && echo "Downloading AFNI ..."     && curl -fL https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz     | tar -xz -C /opt/afni-latest --strip-components 1]: exit code: 2

Can anyone please guide me?

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
spuranicommented, Nov 24, 2022

When I am removing && \ from line 43 image

here is the error I get

Sending build context to Docker daemon  16.38kB
Step 1/6 : FROM debian:stable
 ---> 096ef7a0068a
Step 2/6 : ENV PATH="/opt/afni-latest:$PATH"     AFNI_PLUGINPATH="/opt/afni-latest"
 ---> Using cache
 ---> 1ef720b7f33d
Step 3/6 : RUN apt-get update -qq     && apt-get install -y -q --no-install-recommends            ca-certificates            cmake            curl            ed            gsl-bin            libcurl4-openssl-dev            libgl1-mesa-dri            libglib2.0-0            libglu1-mesa-dev            libglw1-mesa            libgomp1            libjpeg-turbo8-dev            libjpeg62            libssl-dev            libudunits2-dev            libxm4            multiarch-support            netpbm            python-is-python3            python3-pip            tcsh            xfonts-base            xvfb     && rm -rf /var/lib/apt/lists/*     && _reproenv_tmppath="$(mktemp -t tmp.XXXXXXXXXX.deb)"     && curl -fsSL --retry 5 -o "${_reproenv_tmppath}" http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb     && apt-get install --yes -q "${_reproenv_tmppath}"     && rm "${_reproenv_tmppath}"     && _reproenv_tmppath="$(mktemp -t tmp.XXXXXXXXXX.deb)"     && curl -fsSL --retry 5 -o "${_reproenv_tmppath}" http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb     && apt-get install --yes -q "${_reproenv_tmppath}"     && rm "${_reproenv_tmppath}"     && apt-get update -qq     && apt-get install --yes --quiet --fix-missing     && rm -rf /var/lib/apt/lists/*     && > dev/null     && gsl_path="$(find / -name 'libgsl.so.??' || printf '')"     && if [ -n "$gsl_path" ]; then          ln -sfv "$gsl_path" "$(dirname $gsl_path)/libgsl.so.0";     fi     && ldconfig     && mkdir -p /opt/afni-latest     && echo "Downloading AFNI ..."     && curl -fL https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz     | tar -xz -C /opt/afni-latest --strip-components 1
 ---> Running in 62cc348ce22c
Reading package lists...
Building dependency tree...
Reading state information...
Package libjpeg-turbo8-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libjpeg-turbo8-dev' has no installation candidate
E: Unable to locate package multiarch-support
The command '/bin/sh -c apt-get update -qq     && apt-get install -y -q --no-install-recommends            ca-certificates            cmake            curl            ed            gsl-bin            libcurl4-openssl-dev            libgl1-mesa-dri            libglib2.0-0            libglu1-mesa-dev            libglw1-mesa            libgomp1            libjpeg-turbo8-dev            libjpeg62            libssl-dev            libudunits2-dev            libxm4            multiarch-support            netpbm            python-is-python3            python3-pip            tcsh            xfonts-base            xvfb     && rm -rf /var/lib/apt/lists/*     && _reproenv_tmppath="$(mktemp -t tmp.XXXXXXXXXX.deb)"     && curl -fsSL --retry 5 -o "${_reproenv_tmppath}" http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb     && apt-get install --yes -q "${_reproenv_tmppath}"     && rm "${_reproenv_tmppath}"     && _reproenv_tmppath="$(mktemp -t tmp.XXXXXXXXXX.deb)"     && curl -fsSL --retry 5 -o "${_reproenv_tmppath}" http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb     && apt-get install --yes -q "${_reproenv_tmppath}"     && rm "${_reproenv_tmppath}"     && apt-get update -qq     && apt-get install --yes --quiet --fix-missing     && rm -rf /var/lib/apt/lists/*     && > dev/null     && gsl_path="$(find / -name 'libgsl.so.??' || printf '')"     && if [ -n "$gsl_path" ]; then          ln -sfv "$gsl_path" "$(dirname $gsl_path)/libgsl.so.0";     fi     && ldconfig     && mkdir -p /opt/afni-latest     && echo "Downloading AFNI ..."     && curl -fL https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz     | tar -xz -C /opt/afni-latest --strip-components 1' returned a non-zero code: 100

Debian does not have libjpeg-turbo8-dev and multiarchsupport multiarch issue neurodocker

debian packages it has libjpeg62-turbo-dev

0reactions
stebo85commented, Nov 29, 2022

Dear @spurani and @anandsaini024

can you try this:

yes | pip uninstall neurodocker

pip install --no-cache-dir https://github.com/NeuroDesk/neurodocker/tarball/fix-afni-recipe-spaces-python-R-packages  --upgrade

and as a base container I found that fedora:36 works best for AFNI.

Here you can find how we build AFNI for the neurodesk project: https://github.com/NeuroDesk/neurocontainers/tree/master/recipes/afni

You could also directly use the neurodesk AFNI container if you like - then you don’t have to build it yourself 😃 https://www.neurodesk.org/docs/neurocontainers/docker/

This would give you the current afni docker container (we also provide singularity containers):

docker pull vnmd/afni_22.3.06

Thank you Steffen

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can not build AFNI using Neurodocker · Issue #98 - GitHub
Hi: I am getting the following error during the build of AFNI using a dockerfile generated by neurodocker: configure: Need to download and...
Read more >
AFNI Docker container not working
Hi all! I'm trying to run AFNI within a Docker container. I start the container with this command: "docker run -it --rm afni/afni:latest"....
Read more >
Previously working Neurodocker image failing - Neurostars
I've tried to debug this, reseting Docker to factory defaults, trying a different Neurodebian build (trust-non-free, instead of stretch-non-free ...
Read more >
Docker File Non-Zero Code 100 Error When Building
This is a prebuilt docker file from a repository for neuroimaging, so I would figure that it would work. Is this something wrong...
Read more >
neurodocker - PyPI
software argument description AFNI version* latest install_path Installation path. Default /opt/afni‑ . install_r If true, install R.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found