4

I'm trying to build a Dockerfile. It has a tool called Atria that utilizes Julia. Since Ubuntu 22.04 does not have Julia package, I had to resort to installing it. The following is the Dockerfile:

FROM ubuntu:22.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 pip3 install RSeQC

Install biopython=1.80

RUN pip3 install biopython

#Install Julia RUN wget https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.1-linux-x86_64.tar.gz &&
tar zxvf julia-1.8.1-linux-x86_64.tar.gz &&
mv julia-1.8.1/bin/julia /usr/local/bin/julia &&
chmod +x /usr/local/bin/julia

RUN /sbin/ldconfig -v

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

What I have tried so far is :

  1. Julia v1.6.7 and v1.8.4

  2. RUN /sbin/ldconfig -v as suggested here

How to fix it? Should I try to install Julia using PPA?

edit- The error:

root@b0f4b17a7c18:/# atria
/usr/local/bin/julia: error while loading shared libraries: libjulia.so.1: cannot open shared object file: No such file or directory

It is recognizing the atria command tho.

pubsurfted
  • 383
  • 1
  • 6

2 Answers2

2

You just need to make sure you include the required library files when you install Atria. Since you're not building any software (i.e. using make), the usual way is to simply move the directory under /opt and add the executable(s) to your PATH using the ENV keyword. Note that Julia comes bundled with Atria, so all you need is:

FROM ubuntu:22.04

RUN apt-get update && apt-get install -y
bowtie2
openjdk-8-jdk
pbzip2
pigz
python3.10
python3-pip
python3-biopython
wget
&& apt-get clean
&& rm -rf /var/lib/apt/lists/*

Install RSeQC

RUN pip3 install --no-cache-dir RSeQC

Install Atria

RUN wget -q https://github.com/cihga39871/Atria/releases/download/v3.1.2/atria-3.1.2-linux.tar.gz
&& tar xf atria-3.1.2-linux.tar.gz
&& mv atria-3.1.2 /opt/atria

Install findtail

RUN wget -q https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/findtail/findtail_v1.01
&& chmod +x findtail_v1.01
&& mv findtail_v1.01 /usr/local/bin/findtail

Add the Atria executable to the PATH

ENV PATH="/opt/atria/bin:${PATH}"

Steve
  • 3,099
  • 1
  • 4
  • 12
  • Hello @Steve, thank you for that. I'm still a novice (obviously lol) trying to wrap my head around this stuff and I so appreciate your time and effort in helping me out. – pubsurfted Dec 31 '22 at 18:25
  • I don't understand what modifications to make, as the question and answer are rather sizeable files, can you show a more minimal example? – Cornelius Roemer Jan 30 '24 at 17:22
1

Just to note RUN apt clean ... is much better performed using && apt clean, like in @Steve's approach, recommended for complicated reasons.

Suggestion: what about using the official Julia Docker as the base rather than create it from scratch? There isn't a Ubuntu Julia but there is a Debian base.

docker run -it --rm Julia

or

docker pull julia

or via a Dockerfile,

FROM Julia:buster

or

FROM Julia:latest
M__
  • 12,263
  • 5
  • 28
  • 47
  • Doesn't work when you want to layer Julia on top of an existing image that contains a lot of stuff you don't wont to re-layer on the Julia base image – Cornelius Roemer Jan 30 '24 at 17:20