mirror of
https://github.com/hanzoai/docker-github-actions-runner.git
synced 2026-09-30 21:42:55 +00:00
Select apt packages to install from config.json
This commit is contained in:
+44
-1
@@ -2,5 +2,48 @@
|
||||
"user": {
|
||||
"user-id": 1001,
|
||||
"group-id": 121
|
||||
}
|
||||
},
|
||||
"install": [
|
||||
{
|
||||
"category": "development",
|
||||
"source": "apt",
|
||||
"packages": [
|
||||
"build-essential",
|
||||
"zlib1g-dev",
|
||||
"zstd",
|
||||
"gettext",
|
||||
"libcurl4-openssl-dev",
|
||||
"libpq-dev",
|
||||
"pkg-config",
|
||||
"software-properties-common"
|
||||
]
|
||||
},
|
||||
{
|
||||
"category": "network-tools",
|
||||
"source": "apt",
|
||||
"packages": [
|
||||
"inetutils-ping",
|
||||
"wget",
|
||||
"openssh-client",
|
||||
"rsync"
|
||||
]
|
||||
},
|
||||
{
|
||||
"category": "nodejs",
|
||||
"source": "apt",
|
||||
"packages": [
|
||||
"nodejs"
|
||||
]
|
||||
},
|
||||
{
|
||||
"category": "python",
|
||||
"source": "apt",
|
||||
"packages": [
|
||||
"python3",
|
||||
"python3-pip",
|
||||
"python3-setuptools",
|
||||
"python3-venv"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
+10
-2
@@ -1,10 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
function config_file() {
|
||||
echo "$(dirname "${BASH_SOURCE[0]}")/config.json"
|
||||
}
|
||||
|
||||
function user_id() {
|
||||
jq -r '.user."user-id"' "$(dirname "${BASH_SOURCE[0]}")/config.json"
|
||||
jq -r '.user."user-id"' "$(config_file)"
|
||||
}
|
||||
|
||||
function group_id() {
|
||||
jq -r '.user."group-id"' "$(dirname "${BASH_SOURCE[0]}")/config.json"
|
||||
jq -r '.user."group-id"' "$(config_file)"
|
||||
}
|
||||
|
||||
function apt_packages() {
|
||||
jq -r '.install[] | select(.source == "apt") | .packages[]' "$(config_file)" | paste -sd ' ' -
|
||||
}
|
||||
|
||||
+15
-31
@@ -1,43 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
function install_bootstrap() {
|
||||
# Required by the build or runner operation
|
||||
function install_essentials() {
|
||||
apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
curl \
|
||||
jq \
|
||||
gnupg
|
||||
gnupg \
|
||||
tar \
|
||||
unzip \
|
||||
zip \
|
||||
apt-transport-https \
|
||||
sudo \
|
||||
dirmngr \
|
||||
locales \
|
||||
gosu \
|
||||
gpg-agent \
|
||||
dumb-init
|
||||
}
|
||||
|
||||
function install_tools_apt() {
|
||||
apt-get install -y --no-install-recommends \
|
||||
tar \
|
||||
unzip \
|
||||
zip \
|
||||
apt-transport-https \
|
||||
sudo \
|
||||
gpg-agent \
|
||||
software-properties-common \
|
||||
dirmngr \
|
||||
locales \
|
||||
dumb-init \
|
||||
gosu \
|
||||
build-essential \
|
||||
zlib1g-dev \
|
||||
zstd \
|
||||
gettext \
|
||||
libcurl4-openssl-dev \
|
||||
inetutils-ping \
|
||||
wget \
|
||||
openssh-client \
|
||||
python3-pip \
|
||||
python3-setuptools \
|
||||
python3-venv \
|
||||
python3 \
|
||||
nodejs \
|
||||
rsync \
|
||||
libpq-dev \
|
||||
pkg-config
|
||||
apt_packages | xargs apt-get install -y --no-install-recommends
|
||||
}
|
||||
|
||||
function remove_caches() {
|
||||
@@ -61,7 +45,7 @@ source "$scripts_dir/tools.sh"
|
||||
source "$scripts_dir/config.sh"
|
||||
|
||||
apt-get update
|
||||
install_bootstrap
|
||||
install_essentials
|
||||
configure_sources
|
||||
|
||||
apt-get update
|
||||
|
||||
Reference in New Issue
Block a user