Update linuxkit/alpine

Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
Avi Deitcher 2025-01-03 13:28:18 +02:00
parent dc8c6d5985
commit 59c3f62102
4 changed files with 23 additions and 6 deletions

View File

@ -1,4 +1,4 @@
ARG ALPINE_VERSION=3.19
ARG ALPINE_VERSION=3.21
FROM alpine:${ALPINE_VERSION} AS mirror
# update base image

View File

@ -5,15 +5,24 @@ IMAGE=alpine
DEPS=packages
ARCH := $(shell uname -m)
DARCH := $(ARCH)
ifeq ($(ARCH), x86_64)
DEPS += packages.x86_64
DARCH = amd64
endif
ifeq ($(ARCH), aarch64)
DEPS += packages.aarch64
DARCH = arm64
endif
ifeq ($(ARCH), s390x)
DEPS += packages.s390x
endif
ifeq ($(ARCH), riscv64)
DEPS += packages.riscv64
DARCH = riscv64
endif
PLATFORM := linux/$(DARCH)
ORG?=linuxkit
IMAGE?=alpine
@ -30,14 +39,14 @@ show-tag:
@echo "$(ORG)/$(IMAGE):$(TAG)"
iid: Dockerfile Makefile $(DEPS)
docker build --no-cache --iidfile iid .
docker build --platform $(PLATFORM) --no-cache --iidfile iid .
hash: Makefile iid
docker run --rm $(shell cat iid) cat /etc/alpine-hash-arch > $@
docker run --rm --platform $(PLATFORM) $(shell cat iid) cat /etc/alpine-hash-arch > $@
versions.$(ARCH): Makefile hash iid
echo "# $(ORG)/$(IMAGE):$(shell cat hash)" > versions.$(ARCH)
docker run --rm $(shell cat iid) find /mirror -name '*.apk' -exec basename '{}' .apk \; | LANG=C sort | (echo '# automatically generated list of installed packages'; cat -) >> versions.$(ARCH)
docker run --rm --platform $(PLATFORM) $(shell cat iid) find /mirror -name '*.apk' -exec basename '{}' .apk \; | LANG=C sort | (echo '# automatically generated list of installed packages'; cat -) >> versions.$(ARCH)
push: hash iid versions.$(ARCH)
docker pull $(ORG)/$(IMAGE):$(shell cat hash) || \

View File

@ -34,7 +34,15 @@ go test
>&2 echo "go build..."
[ "${REQUIRE_CGO}" = 1 ] || export CGO_ENABLED=0
export CGO_ENABLED=0
linkmode=""
piemode=""
go install -buildmode pie -ldflags "-linkmode=external -s -w ${ldflags} -extldflags \"-fno-PIC -static\""
if [ "${REQUIRE_CGO}" = 1 ]; then
export CGO_ENABLED=1
linkmode="-linkmode=external"
piemode="-buildmode=pie"
fi
go install ${piemode} -ldflags "${linkmode} -s -w ${ldflags} -extldflags \"-fno-PIC -static\""

View File