Lot_to_learn
Lot_to_learn

Reputation: 622

How to do configure,make and make install in docker build

Problem Statement

I am building a docker of my computational bioinformatics pipeline which contains many tools that will be called at different steps of pipelines. In this process, I am trying to add one tool The ViennaRNA Package which will be downloaded and compliled using source code. I have tried many ways to compile it in docker build (as shown below) but none of them is working.

Failed attempts

Code-1 :

FROM jupyter/scipy-notebook

USER root

MAINTAINER Vivek Ruhela <[email protected]>

# Copy the application folder inside the container
ADD . /test1

# Set the default directory where CMD will execute
WORKDIR /test1

# Set environment variable
ENV HOME /test1 

# Install RNAFold
RUN wget https://www.tbi.univie.ac.at/RNA/download/sourcecode/2_4_x/ViennaRNA-2.4.14.tar.gz -P ~/Tools
RUN tar xvzf ~/Tools/ViennaRNA-2.4.14.tar.gz -C ~/Tools  
WORKDIR "~/Tools/ViennaRNA-2.4.14/"
RUN ./configure
RUN make && make check && make install 

Error : configure file not found

Code-2 :

FROM jupyter/scipy-notebook

USER root

MAINTAINER Vivek Ruhela <[email protected]>

# Copy the application folder inside the container
ADD . /test1

# Set the default directory where CMD will execute
WORKDIR /test1

# Set environment variable
ENV HOME /test1 

# Install RNAFold
RUN wget https://www.tbi.univie.ac.at/RNA/download/sourcecode/2_4_x/ViennaRNA-2.4.14.tar.gz -P ~/Tools
RUN tar xvzf ~/Tools/ViennaRNA-2.4.14.tar.gz -C ~/Tools  
RUN bash ~/Tools/ViennaRNA-2.4.14/configure
WORKDIR "~/Tools/ViennaRNA-2.4.14/"
RUN make && make check && make install 

Error : make: *** No targets specified and no makefile found. Stop.

I also tried another way to tell the file location explicitly e.g.

RUN make -C ~/Tools/ViennaRNA-2.4.14/

Sill this approach is not working.

Expected Procedure

I have installed this tool in my system many times using the standard procedure as mentioned in tool documentation as

./configure
make
make check
make install

Similarly for docker, the following code should work

WORKDIR ~/Tools/ViennaRNA-2.4.14/
RUN ./configure && make && make check && make install

But this code is not working because I don't see any effect of workdir. I have checked that configure is creating makefile properly in my system. So it should create the make file in docker also. Any suggestions on why this code is not working.

Upvotes: 4

Views: 6234

Answers (1)

LinPy
LinPy

Reputation: 18608

you are extract all the files in Tools folder which is in home ,try this:

WORKDIR $HOME/Tools/ViennaRNA-2.4.14
RUN ./configure
RUN make && make check && make install 

the problem is WORKDIR ~/Tools/ViennaRNA-2.4.14/ is translated to exactly ~/Tools/ViennaRNA-2.4.14/ which is created a folder named ~ , you may also use $HOME instead

Upvotes: 3

Related Questions