-
Notifications
You must be signed in to change notification settings - Fork 77
/
Dockerfile
83 lines (68 loc) · 3.38 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
79
80
81
82
##############################################################
# Experimental Docker file for the Artemis software suite.
#
# Please see usage documentation at Docker Hub:
#
# https://hub.docker.com/r/sangerpathogens/artemis
#
##############################################################
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
LABEL maintainer="[email protected]"
# Build and environment configuration
ARG ARTEMIS_BUILD_DIR=/artemis-build
ARG INSTALL_DIR=/opt/artemis
ARG BLAST_INSTALL_DIR=/usr/local/ncbi/blast/
ARG BROWSER_INSTALL_DIR=/usr/local/firefox
ARG ARTEMIS_WORKDIR=/artemis
ENV JAVA_OPTS="-Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8"
ENV LANG="en_US.UTF-8"
ENV LANGUAGE="en_US.UTF-8"
ENV LC_ALL="en_US.UTF-8"
ENV LC_COLLATE="en_US.UTF-8"
ENV LC_CTYPE="en_US.UTF-8"
# Mount points
RUN mkdir -p $ARTEMIS_WORKDIR && chmod 777 $ARTEMIS_WORKDIR
# Install main dependencies
RUN apt-get update --quiet --assume-yes
RUN apt-get upgrade --quiet --assume-yes
RUN apt-get install --quiet --assume-yes locales openjdk-11-jdk libxtst6 libxrender1 libxext6 libexpat1 fonts-dejavu-core fontconfig-config libfontconfig1 libfreetype6 libpng16-16 curl wget maven ant
RUN update-alternatives --config java
RUN update-alternatives --config javac
RUN echo "Java version installed: `java -version`"
# Set locale
RUN echo en_US.UTF-8 UTF-8 >> /etc/locale.gen
RUN locale-gen en_US.UTF-8
# Build and install Artemis
# No tests are run currently as some of them pop up windows and hence require X
RUN mkdir -p $INSTALL_DIR
RUN mkdir -p $ARTEMIS_BUILD_DIR
COPY . $ARTEMIS_BUILD_DIR
RUN cd $ARTEMIS_BUILD_DIR && mvn validate && mvn -Djarsigner.skip=true -Dskip.tests=true package -P release
RUN tar xvf $ARTEMIS_BUILD_DIR/target/release-artifacts/unix-release/artemis-unix-release-*.tar.gz --strip-components=1 -C ${INSTALL_DIR}
RUN rm -rf $ARTEMIS_BUILD_DIR && rm -rf ~/.m2
# Install Blast+
RUN mkdir -p $BLAST_INSTALL_DIR
RUN curl --fail -L ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.9.0/ncbi-blast-2.9.0+-x64-linux.tar.gz | tar xzf - --strip-components=1 -C $BLAST_INSTALL_DIR
# Install Firefox for use with pfam etc (use firejail for increased security)
RUN apt-get install --quiet --assume-yes libgtk-3-0 libdbus-glib-1-2 libxt6 firejail
RUN mkdir -p $BROWSER_INSTALL_DIR
RUN wget -O firefox.tar.bz2 "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-GB" && \
tar xvf /firefox.tar.bz2 && \
rm -f /firefox.tar.bz2 && \
mv /firefox /usr/local/
RUN echo "firejail --private --dns=8.8.8.8 --dns=8.8.4.4 $BROWSER_INSTALL_DIR/firefox -no-remote "'"$@"' > /usr/bin/firefox && chmod 555 /usr/bin/firefox
# Cleanup
RUN apt-get autoremove
RUN apt-get clean
# Environment
ENV PATH=$INSTALL_DIR:$INSTALL_DIR/dist:$INSTALL_DIR/etc:$BLAST_INSTALL_DIR/bin:$PATH
ENV CLASSPATH=$INSTALL_DIR:$INSTALL_DIR/dist:$INSTALL_DIR/etc:${CLASSPATH}
ENV HOME=$ARTEMIS_WORKDIR
WORKDIR $ARTEMIS_WORKDIR
# Define default command.
CMD echo 'Usage: docker run -d -e DISPLAY="<your display name>:0" -v <your user home directory>:/home/artuser -v <your data folder>:/artemis' && \
echo ' --user $(id -u):$(id -g) -e ARTEMIS_JVM_FLAGS="-Duser.home=/home/artuser -Djava.io.tmpdir=/tmp" --tmpfs /tmp' && \
echo ' --rm artemis <program name [art|act|bamview|dnaplotter]> [program arguments]' && \
echo && \
echo 'For help, please go to http://sanger-pathogens.github.io/Artemis/'