-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcontainer.def
71 lines (54 loc) · 1.96 KB
/
container.def
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
Bootstrap: docker
From: ubuntu:22.04
%files
requirements.txt
%post
apt -y update
apt -y install wget zlib1g-dev libbz2-dev
apt -y install libssl-dev openssl make gcc
### install java
# installing dbus runs into issues running the post script, this is the workaround
apt -y download dbus
dpkg --unpack dbus*.deb
rm /var/lib/dpkg/info/dbus.postinst -f
apt --fix-broken -y install
apt install -yf dbus
# same thing for systemd
apt -y download systemd
dpkg --unpack systemd*.deb
rm /var/lib/dpkg/info/systemd.postinst -f
apt --fix-broken -y install
# finally install java 8
apt install -y openjdk-8-jdk
# download ImageJ
apt -y install wget unzip
wget https://downloads.imagej.net/fiji/latest/fiji-linux64.zip
unzip fiji-linux64.zip
# add BoneJ plugin
./Fiji.app/ImageJ-linux64 --update add-update-sites "BoneJ" "https://sites.imagej.net/BoneJ/"
./Fiji.app/ImageJ-linux64 --update update
# install tkinter (this is to be able to use plt.show()
DEBIAN_FRONTEND=noninteractive apt -y install python3-tk tk-dev
# install python 3.9.7
wget https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tgz
tar xzvf Python-3.9.7.tgz
cd Python-3.9.7
./configure
make
make install
cd ..
# adjust alias (so that we can call python instead of python3.9) -> only works for w/in the post section
alias python="/usr/local/bin/python3.9"
# install pip and adjust alias
apt -y install python-pip
python -m pip install --upgrade wheel setuptools pip
# set up python environment
pip3 install -r requirements.txt
####################
# Example apps
####################
%apprun example
echo "Running example..."
python3.9 Examples/BoneJ_Module_Example.py -f /Fiji.app/ImageJ-linux64
%apphelp example
The app "example" runs an example of the BoneJ Headless Module by running the python script: Examples/BoneJ_Module_Example.py.