-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhri_cont.def
66 lines (54 loc) · 1.69 KB
/
hri_cont.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
Bootstrap: docker
From: ubuntu:22.04
%labels
Maintainer sensible_robots_lab
Version 1.0
%files
# Add your requirements.txt file
/home/peter/Create-A-Container/requirements.txt /opt/requirements.txt
%post
# Set noninteractive frontend to avoid interactive prompts
export DEBIAN_FRONTEND=noninteractive
# Update and install dependencies
apt-get update && apt-get install -y \
build-essential \
wget \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
curl \
llvm \
libncurses5-dev \
libncursesw5-dev \
xz-utils \
tk-dev \
libffi-dev \
liblzma-dev \
git
# Set the timezone to UTC (or change to your preferred timezone)
ln -fs /usr/share/zoneinfo/UTC /etc/localtime
dpkg-reconfigure --frontend noninteractive tzdata
# Install Python 3.12
cd /opt
wget https://www.python.org/ftp/python/3.12.5/Python-3.12.5.tgz
tar xzf Python-3.12.5.tgz
cd Python-3.12.5
./configure --enable-optimizations
make altinstall
ln -s /usr/local/bin/python3.12 /usr/bin/python3.12
# Upgrade pip
python3.12 -m pip cache purge
python3.12 -m ensurepip
python3.12 -m pip install --upgrade pip
# Install requirements
python3.12 -m pip install -r /opt/requirements.txt
echo "export PS1=\"\[\033[01;32m\]Apptainer\[\033[00m\]:\[\033[01;33m\]\w\[\033[00m\]> \"" >> /.singularity.d/env/99-base.sh
%environment
# Set environment variables
export PATH="/opt/myenv/bin:$PATH"
export PYTHON_VERSION=3.12.5
%runscript
# Define the default command to run
exec /bin/bash "$@"