在 dockerfile 中安装奇点时出错

Errors Installing singularity inside dockerfile

我正在尝试 运行 使用旧版本 nextflow (21.04.3) 和 java 版本 8 的 nextflow 管道。由于我必须在远程服务器上使用此管道,所以只能用奇点了。

由于此 nextflow 管道也使用奇点拉调用,因此我还需要在 docker 图像中安装奇点。然后,我可以将此图像 docker 图像转换为奇点图像,然后将其移动到远程服务器。

我正在尝试在 docker 文件中安装奇点,但出现错误,

这是我正在使用的docker文件,

FROM python:3.8.9-slim 
LABEL authors="phil.ewels@scilifelab.se,erik.danielsson@scilifelab.se" \
  description="Docker image containing requirements for the nfcore tools"

# Do not pick up python packages from $HOME
ENV PYTHONNUSERSITE=1

# Update pip to latest version
RUN python -m pip install --upgrade pip

# Install dependencies
COPY requirements.txt requirements.txt
RUN python -m pip install -r requirements.txt

# Install Nextflow dependencies
RUN apt-get update \
  && apt-get upgrade -y \
  && apt-get install -y git \
  && apt-get install -y wget

# Create man dir required for Java installation 
# and install Java
RUN mkdir -p /usr/share/man/man1 \
  && apt-get install -y  openjdk-11-jre \
  && apt-get clean -y && rm -rf /var/lib/apt/lists/*

# Install Singularity 
RUN wget -O- http://neuro.debian.net/lists/xenial.us-ca.full | tee /etc/apt/sources.list.d/neurodebian.sources.list && \ apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9 && \ apt-get update 

RUN apt-get install -y singularity-container

# Setup ARG for NXF_VER ENV
ARG NXF_VER=""
ENV NXF_VER ${NXF_VER}
# Install Nextflow
RUN wget https://github.com/nextflow- io/nextflow/releases/download/v21.04.3/nextflow | bash \
  && mv nextflow /usr/local/bin \
  && chmod a+rx /usr/local/bin/nextflow
# Add the nf-core source files to the image
COPY . /usr/src/nf_core
WORKDIR /usr/src/nf_core

# Install nf-core
RUN python -m pip install .

# Set up entrypoint and cmd for easy docker usage
CMD [ "." ]

这些是我遇到的错误

Step 9/17 : RUN wget -O- http://neuro.debian.net/lists/xenial.us-ca.full | tee 
/etc/apt/sources.list.d/neurodebian.sources.list && \ apt-key adv --recv-keys -- 
keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9 && \ apt-get update
---> Running in afc3dcbbd1ee
--2022-03-17 17:40:19--  http://neuro.debian.net/lists/xenial.us-ca.full
Resolving neuro.debian.net (neuro.debian.net)... 129.170.233.11
Connecting to neuro.debian.net (neuro.debian.net)|129.170.233.11|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 262
Saving to: ‘STDOUT’

 0K                                                       100% 18.4M=0s

deb http://neurodeb.pirsquared.org data main contrib non-free
#deb-src http://neurodeb.pirsquared.org data main contrib non-free
deb http://neurodeb.pirsquared.org xenial main contrib non-free
#deb-src http://neurodeb.pirsquared.org xenial main contrib non-free
2022-03-17 17:40:19 (18.4 MB/s) - written to stdout [262/262]

/bin/sh: 1:  apt-key: not found
The command '/bin/sh -c wget -O- http://neuro.debian.net/lists/xenial.us-ca.full | tee /etc/apt/sources.list.d/neurodebian.sources.list && \ apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9 && \ apt-get update' 
returned a non-zero code: 127

我有办法使用 docker 文件安装奇点吗?

谢谢

我根据 linux 中安装奇点的方法对 dockerfile 进行了一些更改,给定 here

我能够 运行 成功使用 nextflow,java 和奇点中的奇点的完整 dockerfile,

FROM python:3.8.9-slim 
LABEL 
authors="phil.ewels@scilifelab.se,erik.danielsson@scilifelab.se" \
  description="Docker image containing requirements for the nfcore tools"

# Do not pick up python packages from $HOME
ENV PYTHONNUSERSITE=1

# Update pip to latest version
RUN python -m pip install --upgrade pip

# Install dependencies
COPY requirements.txt requirements.txt
RUN python -m pip install -r requirements.txt

# Install Nextflow dependencies
RUN apt-get update \
  && apt-get upgrade -y \
  && apt-get install -y git \
  && apt-get install -y wget

# Create man dir required for Java installation 
# and install Java
RUN mkdir -p /usr/share/man/man1 \
  && apt-get install -y  openjdk-11-jre \
  && apt-get clean -y && rm -rf /var/lib/apt/lists/*


# Install Singularity

RUN apt-get update && apt-get install -y \
build-essential \
libssl-dev \
uuid-dev \
libgpgme11-dev \
squashfs-tools \
libseccomp-dev \
wget \
pkg-config \
procps

# Download Go source version 1.16.3, install them and modify the PATH
ENV VERSION=1.16.3 
ENV OS=linux 
ENV ARCH=amd64
RUN wget https://dl.google.com/go/go$VERSION.$OS-$ARCH.tar.gz && \
tar -C /usr/local -xzvf go$VERSION.$OS-$ARCH.tar.gz && \
rm go$VERSION.$OS-$ARCH.tar.gz && \
echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a /etc/profile

# Download Singularity from version 3.7.3 (security version)
ENV VERSION=3.7.3
RUN wget https://github.com/sylabs/singularity/releases/download/v${VERSION}/singularity-${VERSION}.tar.gz && \
tar -xzf singularity-${VERSION}.tar.gz


# Compile Singularity sources and install it


RUN export PATH=$PATH:/usr/local/go/bin && \
cd singularity && \
./mconfig --without-suid && \
make -C ./builddir && \
make -C ./builddir install

# Setup ARG for NXF_VER ENV
ARG NXF_VER=""
ENV NXF_VER ${NXF_VER}
# Install Nextflow
RUN wget https://github.com/nextflow-io/nextflow/releases/download/v21.04.3/nextflow | bash \
  && mv nextflow /usr/local/bin \
  && chmod a+rx /usr/local/bin/nextflow
# Add the nf-core source files to the image
COPY . /usr/src/nf_core
WORKDIR /usr/src/nf_core

# Install nf-core
RUN python -m pip install .

# Set up entrypoint and cmd for easy docker usage
CMD [ "." ]