Skip to content

Commit ac350b9

Browse files
committed
Test script can take environment variable to build multiple platforms
1 parent ebd79b3 commit ac350b9

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,8 @@ jobs:
3232
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
3333
3434
- name: Build and test the image
35-
run: ./tests.sh
36-
37-
# - name: Test an ARM build
38-
# run: docker buildx build --output "type=image,push=false" --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x --tag testarm:snapshot --file ./Dockerfile .
39-
35+
run: DOCKER_PLATFORM=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x ./tests.sh
36+
4037
- name: Scan the image
4138
id: scan
4239
uses: anchore/scan-action@v2

tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ if ! [ -x "$(command -v jq)" ]; then
2626
sudo apt -y install jq
2727
fi
2828

29-
29+
PLATFORM=${DOCKER_PLATFORM:-linux/amd64}
3030
message " Build image "
31-
docker build -t mendhak/http-https-echo:latest .
31+
docker buildx build --output "type=image,push=false" --platform $PLATFORM --tag mendhak/http-https-echo:latest --file ./Dockerfile .
3232

3333
mkdir -p testarea
3434
pushd testarea

0 commit comments

Comments
 (0)