Add Gitea Alpine registry workflow
This commit is contained in:
@@ -4,9 +4,18 @@ set -euo pipefail
|
||||
command_name="${1:-build}"
|
||||
requested_arch="${2:-${ALPINE_ARCH:-x86_64}}"
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
alpine_version="${ALPINE_VERSION:-3.22}"
|
||||
alpine_version="${ALPINE_VERSION:-3.23}"
|
||||
repo_name="${ALPINE_REPO_NAME:-local}"
|
||||
build_platform="${ALPINE_BUILD_PLATFORM:-linux/amd64}"
|
||||
builder_uid="$(id -u)"
|
||||
builder_gid="$(id -g)"
|
||||
|
||||
if [[ "${builder_uid}" == "0" ]]; then
|
||||
builder_uid=1000
|
||||
fi
|
||||
if [[ "${builder_gid}" == "0" ]]; then
|
||||
builder_gid=1000
|
||||
fi
|
||||
|
||||
validate_arch() {
|
||||
case "$1" in
|
||||
@@ -26,8 +35,8 @@ run_for_arch() {
|
||||
docker build \
|
||||
--platform "${build_platform}" \
|
||||
--build-arg "ALPINE_VERSION=${alpine_version}" \
|
||||
--build-arg "BUILDER_UID=$(id -u)" \
|
||||
--build-arg "BUILDER_GID=$(id -g)" \
|
||||
--build-arg "BUILDER_UID=${builder_uid}" \
|
||||
--build-arg "BUILDER_GID=${builder_gid}" \
|
||||
-f "${repo_root}/scripts/apk/Dockerfile" \
|
||||
-t "${image_name}" \
|
||||
"${repo_root}"
|
||||
@@ -41,7 +50,7 @@ run_for_arch() {
|
||||
-e "ALPINE_ARCH=${arch}" \
|
||||
-e "CARCH=${arch}" \
|
||||
-e "ALPINE_REPO_NAME=${repo_name}" \
|
||||
-e "PACKAGER=${PACKAGER:-Local Builder <local@example.invalid>}" \
|
||||
-e "PACKAGER=${PACKAGER:-Joachim Schlöffel <me@joachim-schloeffel.com>}" \
|
||||
-v "${repo_root}:/work" \
|
||||
-v "${repo_root}/.cache/abuild:/home/builder/.abuild" \
|
||||
-v "${repo_root}/.cache/apk-distfiles:/var/cache/distfiles" \
|
||||
|
||||
Reference in New Issue
Block a user