简体   繁体   English

构建时Docker文件非零代码100错误

[英]Docker File Non-Zero Code 100 Error When Building

Here is my Docker File: 这是我的Docker文件:

 FROM ubuntu:16.04
MAINTAINER Alexandre Savio <alexsavio@gmail.com>
RUN ln -snf /bin/bash /bin/sh
ARG DEBIAN_FRONTEND=noninteractive
ENV PETPVC_VERSION v1.2.1
ENV PETPVC_GIT https://github.com/UCL/PETPVC.git
ENV ITK_VERSION v4.12.2
ENV ITK_GIT http://itk.org/ITK.git
ENV VTK_VERSION v6.3.0
ENV VTK_GIT https://gitlab.kitware.com/vtk/vtk.git
ENV SIMPLEITK_VERSION v1.0.1
ENV SIMPLEITK_GIT http://itk.org/SimpleITK.git
ENV ANTS_VERSION v2.2.0
ENV ANTS_GIT https://github.com/stnava/ANTs.gi
ENV NEURODEBIAN_URL http://neuro.debian.net/lists/xenial.de-m.full
ENV NEURODEBIAN_PGP hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9
ENV LIBXP_URL http://mirrors.kernel.org/ubuntu/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb
ENV AFNI_URL https://afni.nimh.nih.gov/pub/dist/bin/linux_fedora_21_64/@update.afni.binaries
ENV CAMINO_GIT git://git.code.sf.net/p/camino/code
ENV SPM12_URL http://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/dev/spm12_latest_Linux_R2017b.zip
ENV MLAB_URL http://ssd.mathworks.com/supportfiles/downloads/R2017b/deployment_files/R2017b/installers/glnxa64/MCR_R2017b_glnxa64_installer.zip
ENV MCR_VERSION_DIR v93
ENV PYENV_NAME pyenv
ENV N_CPUS 2
RUN apt-get update && \
    apt-get -y install apt-utils locales && \
    echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
    locale-gen en_US.utf8 && \
    /usr/sbin/update-locale LANG=en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV TERM xterm
ENV HOME /work
ENV SOFT $HOME/soft
ENV BASHRC $HOME/.bashrc
ENV BASICUSER basicuser
ENV BASICUSER_UID 1000
RUN useradd -m -d $HOME -s /bin/bash -N -u $BASICUSER_UID $BASICUSER && \
    mkdir $SOFT && \
    mkdir $HOME/.scripts && \
    mkdir $HOME/.nipype
USER $BASICUSER
WORKDIR $HOME
COPY root/.* $HOME/
COPY root/* $HOME/
COPY root/.scripts/* $HOME/.scripts/
COPY root/.nipype/* $HOME/.nipype/
USER root
RUN \
    chown -R $BASICUSER $HOME && \
    echo "export SOFT=\$HOME/soft" >> $BASHRC && \
    echo "source /etc/fsl/5.0/fsl.sh" >> $BASHRC && \
    echo "export FSLPARALLEL=condor"  >> $BASHRC && \
    apt-get update && \
    apt-get install -y wget bzip2 unzip htop curl git && \
    wget -O- $NEURODEBIAN_URL | tee /etc/apt/sources.list.d/neurodebian.sources.list && \
    apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9 && \
    sed -i "s/# \(.*multiverse$\)/\1/g" /etc/apt/sources.list && \
    echo 'deb-src http://archive.ubuntu.com/ubuntu xenial main restricted' | tee /etc/apt/sources.list && \
    apt-get update && \
    apt-get -y upgrade && \
    apt-get install -y \
apt-utils \
locales \
cmake \
gcc-4.9 \
g++-4.9 \
gfortran-4.9 \
gcc-5 \
g++-5 \
gfortran-5 \
tcsh \
libjpeg62 \
libxml2-dev \
libxslt1-dev \
dicomnifti \
dcm2niix \
xdot \
fsl-5.0-eddy-nonfree \
fsl-5.0-core && \
rm -rf /var/lib/apt/lists/* && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5   90 --slave /usr/bin/g++ g++ /usr/bin/g++-5 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 80 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9 && \
  apt-get build-dep vtk6

 && ln -s /usr/lib/x86_64-linux-gnu/libgsl.so /usr/lib/libgsl.so.0 && \ </code>

I'm specifically getting the error here 我特意在这里得到错误

Error: The command returned a nonzero code 100 错误:该命令返回非零代码100

RUN \
    chown -R $BASICUSER $HOME && \
    echo "export SOFT=\$HOME/soft" >> $BASHRC && \
    echo "source /etc/fsl/5.0/fsl.sh" >> $BASHRC && \
    echo "export FSLPARALLEL=condor"  >> $BASHRC && \
    apt-get update && \
    apt-get install -y wget bzip2 unzip htop curl git && \
    wget -O- $NEURODEBIAN_URL | tee /etc/apt/sources.list.d/neurodebian.sources.list && \
    apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9 && \
    sed -i "s/# (.multiverse$)/\1/g" /etc/apt/sources.list && \
    echo 'deb-src http://archive.ubuntu.com/ubuntu xenial main restricted' | tee /etc/apt/sources.list && \
    apt-get update && \
    apt-get -y upgrade && \
    apt-get install -y \

This is a prebuilt docker file from a repository for neuroimaging, so I would figure that it would work. 这是一个来自存储库的预构建的docker文件,用于神经影像学,所以我认为它会起作用。 Is this something wrong on my end? 这是我的错吗?

I'm not entirely sure how to go about debugging and solving this problem. 我不完全确定如何调试和解决这个问题。

On your apt-get install line, add -y ... what is happening is that your build cannot complete as it is waiting for user confirmation to allow the install, something which will never happen because the Docker build process is non-interactive. 在你的apt-get install行中,添加-y ...正在发生的事情是你的构建无法完成,因为它等待用户确认允许安装,这是因为Docker构建过程是非交互式的,所以永远不会发生。

That should fix you up! 这应该可以解决你的问题!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM