Skip to content

Commit 20374d3

Browse files
committed
refactor: Removed unused dependencies, re-added locale generation
1 parent fa7028f commit 20374d3

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

APKBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ package() {
4545
}
4646

4747
bin() {
48-
depends="$pkgname bash libc6-compat libgcc"
48+
depends="$pkgname"
4949
mkdir -p "$subpkgdir"/usr/glibc-compat
5050
cp -a "$srcdir"/usr/glibc-compat/bin "$subpkgdir"/usr/glibc-compat
5151
cp -a "$srcdir"/usr/glibc-compat/sbin "$subpkgdir"/usr/glibc-compat

Dockerfile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ COPY builder /builder
1616
ARG GLIBC_VERSION=2.41
1717
RUN env PREFIX_DIR=/usr/glibc-compat /builder
1818

19+
1920
# Stage 2: use docker-alpine-abuild package apk and keys
2021
FROM alpine:3.20 AS packager
21-
RUN apk --no-cache add alpine-sdk coreutils cmake sudo bash \
22+
RUN apk --no-cache add alpine-sdk coreutils cmake sudo \
2223
&& adduser -G abuild -g "Alpine Package Builder" -s /bin/ash -D builder \
2324
&& echo "builder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
2425
&& mkdir /packages \
@@ -43,7 +44,8 @@ RUN case "$TARGETARCH" in \
4344
sed -i "s/^arch=.*$/arch=\"${TARGET_ARCH}\"/" APKBUILD && \
4445
abuild checksum && \
4546
env REPODEST=/packages abuilder -r && \
46-
cp /packages/builder/${TARGET_ARCH}/*.apk /tmp/
47+
mv /packages/builder/${TARGET_ARCH}/*.apk /tmp/
48+
4749

4850
# Stage 3: apk add apk, build alpine-glibc
4951
FROM alpine:3.21
@@ -56,6 +58,10 @@ RUN --mount=from=packager,src=/tmp/,dst=/tmp/ \
5658
arm64) export LD_LINUX_PATH="/lib/ld-linux-aarch64.so.1" ;; \
5759
*) echo "Unsupported architecture: $TARGETARCH" && exit 1 ;; \
5860
esac && \
59-
apk add --no-cache gcompat && rm ${LD_LINUX_PATH} && \
60-
apk add --no-cache --force-overwrite /tmp/glibc-${GLIBC_VERSION}-*.apk && \
61-
apk add --no-cache /tmp/glibc-bin-${GLIBC_VERSION}-*.apk
61+
apk add --no-cache \
62+
/tmp/glibc-${GLIBC_VERSION}-*.apk \
63+
/tmp/glibc-bin-${GLIBC_VERSION}-*.apk \
64+
/tmp/glibc-i18n-${GLIBC_VERSION}-*.apk && \
65+
/usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 C.UTF-8 || true && \
66+
echo "export LANG=C.UTF-8" > /etc/profile.d/locale.sh && \
67+
apk del glibc-i18n

abuilder

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,9 @@ main() {
1212
echo -e "$RSA_PRIVATE_KEY" >"/home/builder/.abuild/$RSA_PRIVATE_KEY_NAME"
1313
export PACKAGER_PRIVKEY="/home/builder/.abuild/$RSA_PRIVATE_KEY_NAME"
1414
}
15-
ls -lh /home/builder/.abuild
16-
echo "PACKAGE_PRIVKEY ${PACKAGER_PRIVKEY}"
1715
sudo chown -R builder:abuild /home/builder/package
1816
sudo chown -R builder:abuild $REPODEST
1917

20-
# exec abuild -r clean
2118
exec abuild "$@"
2219
}
2320

builder

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -eo pipefail
4-
[[ "$TRACE" ]] && set -x
3+
set -exo pipefail
54

65
main() {
76
declare version="${1:-$GLIBC_VERSION}" prefix="${2:-$PREFIX_DIR}"

0 commit comments

Comments
 (0)