Skip to content

Commit

Permalink
Merge pull request #56 from chancez/misc_helpers
Browse files Browse the repository at this point in the history
Fix running on ARM Macs and support nerdctl
  • Loading branch information
jandubois authored Apr 21, 2022
2 parents ea21657 + 67bc16b commit 8d34332
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ ALPINE_VERSION ?= 3.14.3
REPO_VERSION ?= $(shell echo "$(ALPINE_VERSION)" | sed -E 's/^([0-9]+\.[0-9]+).*/v\1/')
GIT_TAG ?= $(shell echo "v$(ALPINE_VERSION)" | sed 's/^vedge$$/origin\/master/')
BUILD_ID ?= $(shell git describe --tags)
DOCKER ?= docker

# Editions should be 5 chars or less because the full name is used as
# the volume id, and cannot exceed 32 characters.
Expand All @@ -10,6 +11,9 @@ EDITION ?= std

# Architecture defaults to the current system's.
ARCH ?= $(shell uname -m)
ifeq ($(strip $(ARCH)),arm64)
ARCH = aarch64
endif

# ARCH is derived from `uname -m` but the alternate architecture name (e.g. amd64, arm64)
# is required for Docker and asset downloads.
Expand All @@ -25,7 +29,7 @@ BINFMT_IMAGE=tonistiigi/binfmt:qemu-$(QEMU_VERSION)
.PHONY: mkimage
mkimage:
cd src/aports && git fetch && git checkout $(GIT_TAG)
docker build \
$(DOCKER) build \
--tag mkimage:$(ALPINE_VERSION)-$(ARCH) \
--build-arg ALPINE_VERSION=$(ALPINE_VERSION) \
--build-arg BINFMT_IMAGE=$(BINFMT_IMAGE) \
Expand Down
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/usr/bin/env bash
set -eu

DOCKER=${DOCKER:-docker}

mkdir -p iso

TAG="${EDITION}-${ALPINE_VERSION}"

source "edition/${EDITION}"

docker run --rm \
${DOCKER} run --rm \
--platform "linux/${ARCH_ALIAS}" \
-v "${PWD}/iso:/iso" \
-v "${PWD}/mkimg.lima.sh:/home/build/aports/scripts/mkimg.lima.sh:ro" \
Expand Down

0 comments on commit 8d34332

Please sign in to comment.