-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathcustom.sh
More file actions
executable file
·69 lines (57 loc) · 1.61 KB
/
custom.sh
File metadata and controls
executable file
·69 lines (57 loc) · 1.61 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
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash -e
#set -Eeuxo pipefail
printf "\n\t🔧 Preparing apt 🔧\t\n"
# Enable retry logic for apt up to 10 times
echo 'APT::Acquire::Retries "10";' >/etc/apt/apt.conf.d/80-retries
# Configure apt to always assume Y
echo 'APT::Get::Assume-Yes "true";' >/etc/apt/apt.conf.d/90assumeyes
apt-get update
apt-get install apt-utils
# Install apt-fast using quick-install.sh
# https://github.com/ilikenwf/apt-fast
bash -c "$(curl -sL https://raw.githubusercontent.com/ilikenwf/apt-fast/master/quick-install.sh)"
# echo 'session required pam_limits.so' >>/etc/pam.d/common-session
# echo 'session required pam_limits.so' >>/etc/pam.d/common-session-noninteractive
# echo 'DefaultLimitNOFILE=65536' >>/etc/systemd/system.conf
# echo 'DefaultLimitSTACK=16M:infinity' >>/etc/systemd/system.conf
# {
# # Raise Number of File Descriptors
# echo '* soft nofile 65536'
# echo '* hard nofile 65536'
# # Double stack size from default 8192KB
# echo '* soft stack 16384'
# echo '* hard stack 16384'
# } >>/etc/security/limits.conf
case "$(uname -m)" in
'aarch64')
scripts=(
basic
gh
pwsh
go
js
dotnet
)
;;
'x86_64')
scripts=(
basic
gh
pwsh
go
js
rust
vcpkg
dotnet
)
;;
*) exit 1 ;;
esac
for SCRIPT in "${scripts[@]}"; do
printf "\n\t🧨 Executing %s.sh 🧨\t\n" "${SCRIPT}"
"/imagegeneration/installers/${SCRIPT}.sh"
done
printf "\n\t🐋 Cleaning image 🐋\t\n"
apt-get clean
rm -rf /var/cache/* /var/log/* /var/lib/apt/lists/* /tmp/* || echo 'Failed to delete directories'
printf "\n\t🐋 Cleaned up image 🐋\t\n"