0

I'm trying to build a docker image from the following dockerfile:

FROM ubuntu:18.04

# Install Python
RUN apt-get update && apt-get install -y python3.10 python3-pip

# Install Java
RUN apt-get update && apt-get install -y openjdk-8-jdk

# Install Bowtie2
RUN apt-get update && apt-get install -y bowtie2

RUN apt-get update && \
apt-get install --yes --no-install-recommends \
zlib1g-dev \
libbz2-dev \
liblzma-dev \
&& rm -rf /var/lib/apt/lists/*

# Install RSeQC
RUN apt-get update && apt-get install -y python-pip
RUN pip install RSeQC

# Install biopython=1.80
RUN pip install biopython

# Install Atria
RUN apt-get update && apt-get install -y wget
RUN wget https://github.com/cihga39871/Atria/releases/download/v3.1.2/atria-3.1.2-linux.tar.gz
RUN tar -zxf atria-3.1.2-linux.tar.gz
RUN mv atria-3.1.2/bin/atria /usr/local/bin/atria
RUN chmod +x /usr/local/bin/atria

##Atria dependencies
RUN apt-get update && apt-get install pigz pbzip2

# Install findtail
RUN apt-get update && apt-get install -y wget
RUN wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/findtail/findtail_v1.01
RUN mv findtail_v1.01 /usr/local/bin/findtail_v1.01
RUN chmod +x /usr/local/bin/findtail_v1.01

When I try to build the image, it gets stuck at:

Configuring tzdata
------------------

Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.

  1. Africa      4. Australia  7. Atlantic  10. Pacific  13. Etc
  2. America     5. Arctic     8. Europe    11. SystemV
  3. Antarctica  6. Asia       9. Indian    12. US
Geographic area: 6

It remains stuck there forever until I ctrl+c. Any idea why this is happening?

1 Answer 1

1

You need to modify your Dockerfile slightly. An apt update needs to be done once at the beginning. Tzdata is installed as a dependency and configuration does not work. Use the line

RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata. 

You need to adopt the timezone.

Finally your dockerfile may look like:


FROM ubuntu:20.04

# Install tzdata
RUN apt-get update &&\
    DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata

# Install Python, Bowtie2 and Java
RUN apt-get install -y python3.10 python3-pip \ 
    openjdk-8-jdk  \ 
    bowtie2 \ 
    wget

RUN  apt-get install --yes --no-install-recommends \
     zlib1g-dev \
     libbz2-dev \
     liblzma-dev  

# Install RSeQC
RUN pip install RSeQC

# Install biopython=1.80
RUN pip install biopython

# Install Atria
RUN wget https://github.com/cihga39871/Atria/releases/download/v3.1.2/atria-3.1.2-linux.tar.gz && \
    tar -zxf atria-3.1.2-linux.tar.gz && \
    mv atria-3.1.2/bin/atria /usr/local/bin/atria && \
    chmod +x /usr/local/bin/atria

#Atria dependencies
RUN  apt-get install pigz pbzip2

# Install findtail
 RUN wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/findtail/findtail_v1.01 && \
     mv findtail_v1.01 /usr/local/bin/findtail_v1.01 && \
     chmod +x /usr/local/bin/findtail_v1.01 
# Cleanup 
RUN apt clean

and credit goes to how-to-install-tzdata-on-a-ubuntu-docker-image

6
  • Thank you so much! @dummyuser
    – pubsurfted
    Dec 30, 2022 at 14:49
  • 1
    there seems to be another issue with RUN pip install biopython and pyton versions. out of scope of this question.
    – dummyuser
    Dec 30, 2022 at 14:54
  • Yeah i just encountered that issue and made a post about it. Where is the error coming from?
    – pubsurfted
    Dec 30, 2022 at 14:58
  • 1
    the python version in ubuntu 18.04 seems to be too old. why do you use 18.04 ?
    – dummyuser
    Dec 30, 2022 at 15:33
  • 1
    I edited my resonse. 1) line 1 use 20.04 and 2) Line 19: python-pip is not needed - removed. docker build works.
    – dummyuser
    Dec 30, 2022 at 15:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .