Dockerfile 2.7 KB
Newer Older
1
# Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Brandon Walts's avatar
Brandon Walts committed
2
# Copyright [2016-2019] EMBL-European Bioinformatics Institute
3 4 5 6 7 8 9 10 11 12 13 14 15
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#      http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

16 17
# This is a Dockerfile to run eHive scripts (init_pipeline.pl, beekeeper.pl, runWorker.pl) in a container
#
18
## Build the image
19
# docker build -t ensembl-hive -f docker/Dockerfile $EHIVE_ROOT_DIR
20
#
21 22 23
## Check that the test-suite works (guest_language.t is expected to fail
# docker run -e EHIVE_TEST_PIPELINE_URLS=sqlite:/// ensembl-hive prove -r /repo/ensembl-hive/t
#
24 25 26 27 28 29 30
## Open a session in a new container (will run bash)
# docker run -it ensembl-hive
#
## Initialize and run a pipeline
# docker run -it ensembl-hive init_pipeline.pl Bio::EnsEMBL::Hive::Examples::LongMult::PipeConfig::LongMult_conf -pipeline_url $URL
# docker run -it ensembl-hive beekeeper.pl -url $URL -loop -sleep 0.2
# docker run -it ensembl-hive runWorker.pl -url $URL
31

32 33 34 35 36 37 38 39
# 1. Get the current ensembl-hive repo and remove stuff we don't want
FROM alpine:3.9.4 AS repo
RUN apk add git
ADD . /tmp/ensembl-hive
# git clean will remove things listed in .gitignore, incl. .pyc, .jar etc
# but will leave local modifications and other files, thus allowing local tests
RUN cd /tmp/ensembl-hive && git clean -d -X -f
RUN rm -rf /tmp/ensembl-hive/.git
40 41 42

FROM ubuntu:16.04

43
# Install some basic utilities
44
ARG DEBIAN_FRONTEND=noninteractive
45
RUN apt-get update -y \
46
    && apt-get install -y maven curl \
47
    && apt-get clean \
48
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
49

50 51 52 53 54 55
# Intall java
RUN mkdir -p /opt \
    && curl -SL https://download.java.net/java/GA/jdk12.0.1/69cfe15208a647278a19ef0990eea691/12/GPL/openjdk-12.0.1_linux-x64_bin.tar.gz \
    | tar -xzC /opt
ENV JAVA_HOME=/opt/jdk-12.0.1
ENV PATH=$JAVA_HOME/bin:$PATH
56

57 58
# Get the repo
COPY --from=repo /tmp/ensembl-hive /repo/ensembl-hive
59

60
# Install all the dependencies
61 62
RUN /repo/ensembl-hive/docker/setup_os.Ubuntu-16.04.sh \
    && /repo/ensembl-hive/docker/setup_cpan.Ubuntu-16.04.sh /repo/ensembl-hive
63

64
ENV EHIVE_ROOT_DIR "/repo/ensembl-hive"
65 66
ENV PATH "/repo/ensembl-hive/scripts:$PATH"
ENV PERL5LIB "/repo/ensembl-hive/modules:$PERL5LIB"
67

68
ENTRYPOINT [ "/repo/ensembl-hive/scripts/dev/simple_init.py" ]
69
CMD [ "/bin/bash" ]