微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何为Snakemake创建Docker容器 更新

如何解决如何为Snakemake创建Docker容器 更新

这是我第一次创建Docker容器的尝试。 我需要为旧版VarScan2创建一个容器,所以我大部分基于Dockerfile found for a newer version of VarScan2

尝试运行我构建的第一个容器时出现错误提示该容器可能由于Snakemake.utils不可用而无法运行。因此,我认为我需要在需要> = {Snakemake的容器中安装python3.5

我在尝试获取python3.8时遇到了麻烦,因为Snakemake无法在docker build上安装:

错误

Downloading snakemake-5.26.1.tar.gz (237 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_50ix5/snakemake/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_50ix5/snakemake/setup.py'"'"';f=getattr(tokenize,'"'"'open'"'"',open)(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(code,__file__,'"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-AMGZ1t
         cwd: /tmp/pip-install-_50ix5/snakemake/
    Complete output (2 lines):
    At least Python 3.5 is required.
    
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Dockerfile

FROM ubuntu:14.04

MAINTAINER Matthew Jordan Oldach,moldach686@gmail.com

# create a working directory and work from there
RUN mkdir /tmp/install
workdir /tmp/install

RUN apt-get update && apt-get install -y \
        build-essential \
        libncurses5-dev \
        libgdbm-dev \
        libnss3-dev \
        libssl-dev \
        libreadline-dev \
        libffi-dev \
        gcc \
        make \
        zlib1g-dev \
        git \
        wget \
        python3-pip \
        default-jre \
        r-base \
        bc

# [Download python3.7.5 following these instructions][2]
RUN wget https://www.python.org/ftp/python/3.7.5/python-3.7.5.tgz
RUN tar -xf python-3.7.5.tgz
RUN cd python-3.7.5; ./configure --enable-optimizations; cd ..

# Download Snakemake
RUN wget https://bootstrap.pypa.io/get-pip.py
RUN python get-pip.py
RUN pip install snakemake

# Samtools 0.1.18 - note: 0.1.19 and 1.1 do NOT work,VarScan copynumber dies on the mpileup
RUN wget http://downloads.sourceforge.net/project/samtools/samtools/0.1.18/samtools-0.1.18.tar.bz2
RUN tar -xvf samtools-0.1.18.tar.bz2
# the make command generates a lot of warnings,none of them relevant to the final samtools code,hence 2>/dev/null
#RUN (cd samtools-0.1.18/ && make DFLAGS='-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=0' LIBCURSES='' 2>/dev/null && mv samtools /usr/local/bin)

# get varscan 
RUN wget  -O /usr/local/bin/VarScan.jar https://netactuate.dl.sourceforge.net/project/varscan/VarScan.v2.3.9.jar
# Set workdir to /data -- predefined mount location.
RUN mkdir /data
workdir /data

# And clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/install

ENTRYPOINT ["bash","java -jar /usr/local/bin/VarScan.jar"]

如果有人能帮助我弄清楚这里出了什么问题,我将不胜感激。

更新

OneCricketeer解决方解决了该解决方案。

Dockerfile解决方
FROM python:3.7.5

MAINTAINER Matthew Jordan Oldach,moldach686@gmail.com

# create a working directory and work from there
RUN mkdir /tmp/install
workdir /tmp/install

RUN apt-get update && apt-get install -y \
        gcc \
        make \
        zlib1g-dev \
        git \
        wget \
        python3-pip \
        default-jre \
        r-base \
        bc

# Download Snakemake
RUN wget https://bootstrap.pypa.io/get-pip.py
RUN python get-pip.py
RUN pip install snakemake

# Samtools 0.1.18 - note: 0.1.19 and 1.1 do NOT work,"java -jar /usr/local/bin/VarScan.jar"]

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。