1+ Bootstrap: docker
2+ From: ubuntu:22.04
3+
4+ %files
5+ install_boost_openssl.sh .
6+ openssl-package.deb .
7+ boost-package.deb .
8+
9+ %post
10+ echo "Setting up the environment..."
11+
12+ touch /var/log/apt/term.log
13+ if [ -f /var/log/apt/term.log ]; then
14+ chown root:adm /var/log/apt/term.log || true
15+ fi
16+
17+ # Set environment variable to avoid interactive prompts during installation
18+ export DEBIAN_FRONTEND=noninteractive
19+ echo 'APT::Sandbox::User "root";' > /etc/apt/apt.conf.d/no-sandbox
20+ mkdir -p /netscratch
21+
22+ # Update and install base dependencies (including wget here)
23+ apt-get update
24+ apt-get install -y libc6 fakeroot wget git vim
25+
26+ # Fix dependency issues
27+ apt-get install -f -y || true
28+ dpkg --configure -a || true
29+
30+ # Reinstall problematic packages
31+ apt-get remove --purge -y dbus fontconfig-config || true
32+ apt-get install -y dbus fontconfig-config || true
33+
34+ rm -f /var/lib/dpkg/lock-frontend
35+ rm -f /var/lib/dpkg/lock
36+ rm -f /var/cache/apt/archives/lock
37+
38+ # Adjust permissions for dbus helper
39+ chown -R root:root /usr/lib/dbus-1.0/dbus-daemon-launch-helper || true
40+
41+ # Install necessary packages
42+ apt-get install -y fontconfig libfontconfig1 libpangoft2-1.0-0 libbluray2 \
43+ libpangocairo-1.0-0 libavformat58 libpango-1.0-0 \
44+ openjdk-11-jre-headless libcairo2 librsvg2-2 librsvg2-common \
45+ openjdk-11-jre-zero libtheora0 libavcodec58 libcairo-gobject2 \
46+ ca-certificates-java libchromaprint1 software-properties-common perl-modules bzip2 \
47+ unzip zlib1g-dev libtinfo5 g++ usbutils gawk bison gcc make tar python3.9 locales zstd uuid-dev ccache || true
48+
49+ ln -s /usr/bin/python3 /usr/bin/python
50+
51+ locale-gen en_US.UTF-8
52+ update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
53+
54+ # Run dpkg to ensure configuration is complete
55+ dpkg --configure -a || true
56+
57+ # Clean up apt cache
58+ apt-get clean
59+ rm -rf /var/lib/apt/lists/*
60+
61+ echo "Setting up the environment..."
62+
63+ # Install CMake 3.26
64+ echo "Installing CMake 3.26..."
65+ wget https://github.com/Kitware/CMake/releases/download/v3.26.0/cmake-3.26.0-linux-x86_64.sh -O /tmp/cmake.sh
66+ chmod +x /tmp/cmake.sh
67+ mkdir -p /opt/cmake
68+ /tmp/cmake.sh --skip-license --prefix=/opt/cmake
69+ ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake
70+ rm -f /tmp/cmake.sh
71+
72+ # Copy the boost and openssl installation script into the container
73+ cp install_boost_openssl.sh /tmp/
74+
75+ # Execute the installation script
76+ chmod +x /tmp/install_boost_openssl.sh
77+ /tmp/install_boost_openssl.sh
78+
79+ # Clean up
80+ rm -f /tmp/install_boost_openssl.sh
81+
82+ %environment
83+ export LANG=en_US.UTF-8
84+ export LANGUAGE=en_US.UTF-8
85+ export LC_ALL=en_US.UTF-8
86+ export HOME=/home
87+ export LD_LIBRARY_PATH=/opt/boost-1.66/lib:/opt/openssl-1.1/lib:$LD_LIBRARY_PATH
88+
89+ %runscript
90+ exec /bin/bash
91+
92+ %labels
93+ Author Rahul, Udit
94+ Version 2.0
95+
96+ %test
97+ locale
98+ lsusb || echo "lsusb not available"
99+ ls -l /dev/null
100+ echo "Container test successful!"
0 commit comments