-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
78 lines (64 loc) · 2.95 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
FROM quay.io/ucsc_cgl/redwood-client:1.2.1
MAINTAINER Walt Shands [email protected]
#Set the log directory for redwood to be under /tmp since the rest of the file system is locked
ENV REDWOOD_LOG_DIR /tmp
WORKDIR ./
USER root
# Install OpenJDK JRE, curl, python, python pip, and the docker client
RUN apt-get update && apt-get install --yes \
curl \
wget \
python \
python-pip \
docker.io \
python-dev \
libxml2-dev \
libxslt-dev \
lib32z1-dev \
build-essential
RUN pip install --upgrade pip
COPY requirements.txt .
RUN pip install -r requirements.txt
#install cwltool in the container
#use the version required by dockstore
RUN pip install setuptools==36.5.0
RUN pip install cwl-runner cwltool==1.0.20170828135420 schema-salad==2.6.20170806163416 avro==1.8.1 ruamel.yaml==0.14.12 requests==2.18.4
RUN pip install functools32==3.2.3.post2
#Patch the cwltool code that sets up the docker run command line
#so that it includes '-v /var/run/docker.sock:/var/run/docker.sock
#and the mount point for the directory specified by the host environment
#variable TMPDIR
#this will allow the docker run command generated by cwltools inside
#this container to access the host's docker engine
#and launch containers outside this container
#and which will be able to access the same TMPDIR on the host
#this patch addes code to job.py and assumes the file is at
#/usr/local/lib/python2.7/dist-packages/cwltool/job.py
#TODO?? make sure the path exists and the current version
#of python is the right one?
COPY job.patch /usr/local/lib/python2.7/dist-packages/cwltool/job.patch
RUN patch -d /usr/local/lib/python2.7/dist-packages/cwltool/ < /usr/local/lib/python2.7/dist-packages/cwltool/job.patch
COPY main.patch /usr/local/lib/python2.7/dist-packages/cwltool/main.patch
RUN patch -d /usr/local/lib/python2.7/dist-packages/cwltool/ < /usr/local/lib/python2.7/dist-packages/cwltool/main.patch
#copy dockstore files to root so root can run dockstore
COPY .dockstore/ /root/.dockstore
COPY Dockstore/ /root/Dockstore
RUN mkdir /root/.dockstore/plugins
RUN chmod a+x /root/Dockstore/dockstore
RUN mkdir /root/.dockstore/libraries
#install newer Cromwell jar file cromwell-30.2.jar as cromwell-29.jar since Dockstore hard codes the version
RUN wget https://github.com/broadinstitute/cromwell/releases/download/30.2/cromwell-30.2.jar -O /root/.dockstore/libraries/cromwell-29.jar
ENV PATH /root/Dockstore/:$PATH
ENV HOME /root
COPY DockstoreRunner.py /usr/local/bin
RUN chmod a+x /usr/local/bin/DockstoreRunner.py
#since we have not figured out how to run as nonroot
#set the following env var so dockstore does not question
#the fact that we are running as root
ENV DOCKSTORE_ROOT 1
#Indicate to Dockstore where the dockstore jar file is located
ENV DOCKSTORE_HOME /root/.dockstore
#container must run as root in order to access docker.sock on the host
#becuase ubuntu is not a member of the host's docker.sock docker group
#and there is no way to set this up at build time
USER root