Merge pull request #821 from thewtex/oci-exe-buildx-arm64

Enable specification of build tool with OCI_EXE, building images for arm64 hosts
This commit is contained in:
Matt McCormick 2024-03-30 14:36:39 -04:00 committed by GitHub
commit e40a33d02b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 4 deletions

View File

@ -24,7 +24,15 @@ jobs:
submodules: "recursive"
fetch-depth: 1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: build
env:
BUILD_CMD: buildx build --platform linux/amd64,linux/arm64
run: make base
- name: test

View File

@ -4,7 +4,14 @@
#
# Name of the docker executable
DOCKER := docker
DOCKER := $(or $(OCI_EXE), docker)
# The build sub-command. Use:
#
# export "BUILD_CMD=buildx build --platform linux/amd64,linux/arm64"
#
# to generate multi-platform images.
BUILD_CMD := $(or $(BUILD_CMD), build)
# Docker organization to pull the images from
ORG = dockcross
@ -118,7 +125,7 @@ $(GEN_IMAGE_DOCKERFILES) Dockerfile: %Dockerfile: %Dockerfile.in $(DOCKER_COMPOS
web-wasm: web-wasm/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
cp -r test web-wasm/
$(DOCKER) build -t $(ORG)/web-wasm:$(TAG) \
$(DOCKER) $(BUILD_CMD) -t $(ORG)/web-wasm:$(TAG) \
-t $(ORG)/web-wasm:latest \
--build-arg IMAGE=$(ORG)/web-wasm \
--build-arg VERSION=$(TAG) \
@ -225,7 +232,7 @@ manylinux2014-x86.test: manylinux2014-x86
# base
#
base: Dockerfile imagefiles/
$(DOCKER) build -t $(ORG)/base:latest \
$(DOCKER) $(BUILD_CMD) -t $(ORG)/base:latest \
-t $(ORG)/base:$(TAG) \
--build-arg IMAGE=$(ORG)/base \
--build-arg VCS_URL=`git config --get remote.origin.url` \
@ -247,7 +254,7 @@ $(VERBOSE).SILENT: display_images
$(STANDARD_IMAGES): %: %/Dockerfile base
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(DOCKER) build -t $(ORG)/$@:latest \
$(DOCKER) $(BUILD_CMD) -t $(ORG)/$@:latest \
-t $(ORG)/$@:$(TAG) \
--build-arg ORG=$(ORG) \
--build-arg IMAGE=$(ORG)/$@ \