-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathubuntu24.def
More file actions
58 lines (46 loc) · 1.59 KB
/
Copy pathubuntu24.def
File metadata and controls
58 lines (46 loc) · 1.59 KB
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
Bootstrap: docker
From: ubuntu:{{ VERSION }}
Stage: build
%arguments
VERSION=24.04
USERS=user_ub24
ADDITIONAL_LIBS=fish btop rsync unzip task-spooler
%setup
%files
%environment
export LC_ALL=C
%post
alias sudo=""
TZ=Asia/Taipei
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# install essential libraries
apt update && apt upgrade -y
apt install -y tclsh tmux htop neovim build-essential git wget libglib2.0-0 {{ ADDITIONAL_LIBS }}
# install gh cli
sudo mkdir -p -m 755 /etc/apt/keyrings \
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
&& cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& sudo mkdir -p -m 755 /etc/apt/sources.list.d \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
# create folder stubs for users
cd /home
mkdir -p {{ USERS }}
%runscript
%startscript
/bin/bash
%test
grep -q NAME=\"Ubuntu\" /etc/os-release
if [ $? -eq 0 ]; then
echo "Container base is Ubuntu as expected."
else
echo "Container base is not Ubuntu."
exit 1
fi
%labels
Author ckc
Version v0.1.0
%help
This is a definition file template for creating apptainer containers