Initial commit
Some checks failed
Check Case Normalization / Build image using Buildah (push) Failing after 1s
CI checks / Run ESLint (push) Failing after 1s
CI checks / Check Distribution (push) Failing after 0s
CI checks / Check Input and Output enums (push) Failing after 0s
Build with docker/metadata-action / Build image with Containerfile (push) Failing after 2s
Build with docker/metadata-action / Build image without Containerfile (push) Failing after 1s
Link checker / Check links in markdown (push) Failing after 1s
Multiarch build / Build multi-platform image using Containerfile (push) Has been cancelled
Multiarch build / Build multi-architecture image from scratch (push) Has been cancelled
Multiarch build / Build multi-architecture image using Containerfile (push) Has been cancelled
Build / Build image using Buildah (push) Failing after 1s
Build from containerfile / Build image using Buildah (push) Failing after 1s
Some checks failed
Check Case Normalization / Build image using Buildah (push) Failing after 1s
CI checks / Run ESLint (push) Failing after 1s
CI checks / Check Distribution (push) Failing after 0s
CI checks / Check Input and Output enums (push) Failing after 0s
Build with docker/metadata-action / Build image with Containerfile (push) Failing after 2s
Build with docker/metadata-action / Build image without Containerfile (push) Failing after 1s
Link checker / Check links in markdown (push) Failing after 1s
Multiarch build / Build multi-platform image using Containerfile (push) Has been cancelled
Multiarch build / Build multi-architecture image from scratch (push) Has been cancelled
Multiarch build / Build multi-architecture image using Containerfile (push) Has been cancelled
Build / Build image using Buildah (push) Failing after 1s
Build from containerfile / Build image using Buildah (push) Failing after 1s
This commit is contained in:
parent
b7b1ae7dbe
commit
75282d0c68
20 changed files with 1897 additions and 0 deletions
229
.github/workflows/multiarch.yml
vendored
Normal file
229
.github/workflows/multiarch.yml
vendored
Normal file
|
@ -0,0 +1,229 @@
|
|||
name: Multiarch build
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # every day at midnight
|
||||
|
||||
env:
|
||||
PROJECT_DIR: spring-petclinic
|
||||
MVN_REPO_DIR: ~/.m2/repository
|
||||
IMAGE_TAG: latest
|
||||
|
||||
jobs:
|
||||
build-multiarch-containerfile:
|
||||
name: Build multi-architecture image using Containerfile
|
||||
env:
|
||||
IMAGE_NAME: hello-world-multiarch
|
||||
runs-on: container
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
install_latest: [ false ]
|
||||
|
||||
steps:
|
||||
|
||||
# Checkout buildah action github repository
|
||||
- name: Checkout Buildah action
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: "buildah-build"
|
||||
|
||||
- name: Install latest buildah
|
||||
if: matrix.install_latest
|
||||
run: |
|
||||
bash buildah-build/.github/install_latest_buildah.sh
|
||||
|
||||
- name: Install qemu dependency
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y qemu-user-static
|
||||
|
||||
- name: Create Containerfile
|
||||
run: |
|
||||
cat > Containerfile<<EOF
|
||||
|
||||
FROM docker.io/alpine:3.14
|
||||
|
||||
RUN echo "hello world"
|
||||
|
||||
ENTRYPOINT [ "sh", "-c", "echo -n 'Machine: ' && uname -m && echo -n 'Bits: ' && getconf LONG_BIT && echo 'goodbye world'" ]
|
||||
EOF
|
||||
|
||||
- name: Build Image
|
||||
id: build_image_multiarch
|
||||
uses: ./buildah-build/
|
||||
with:
|
||||
image: ${{ env.IMAGE_NAME }}
|
||||
tags: latest v1
|
||||
archs: amd64 # Single arch testcase
|
||||
containerfiles: |
|
||||
./Containerfile
|
||||
|
||||
- name: Echo Outputs
|
||||
run: |
|
||||
echo "Image: ${{ steps.build_image_multiarch.outputs.image }}"
|
||||
echo "Tags: ${{ steps.build_image_multiarch.outputs.tags }}"
|
||||
echo "Tagged Image: ${{ steps.build_image_multiarch.outputs.image-with-tag }}"
|
||||
|
||||
- name: Check images created
|
||||
run: buildah images | grep '${{ env.IMAGE_NAME }}'
|
||||
|
||||
- name: Check image metadata
|
||||
run: |
|
||||
set -x
|
||||
buildah inspect ${{ steps.build_image_multiarch.outputs.image }}:${{ env.IMAGE_TAG }} | jq ".OCIv1.architecture"
|
||||
buildah inspect ${{ steps.build_image_multiarch.outputs.image }}:${{ env.IMAGE_TAG }} | jq ".Docker.architecture"
|
||||
|
||||
- name: Run image
|
||||
run: |
|
||||
podman run --rm ${{ steps.build_image_multiarch.outputs.image }}:${{ env.IMAGE_TAG }}
|
||||
|
||||
build-multiplatform-containerfile:
|
||||
name: Build multi-platform image using Containerfile
|
||||
env:
|
||||
IMAGE_NAME: hello-world-multiplatform
|
||||
runs-on: container
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
install_latest: [ false ]
|
||||
|
||||
steps:
|
||||
|
||||
# Checkout buildah action github repository
|
||||
- name: Checkout Buildah action
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: "buildah-build"
|
||||
|
||||
- name: Install latest buildah
|
||||
if: matrix.install_latest
|
||||
run: |
|
||||
bash buildah-build/.github/install_latest_buildah.sh
|
||||
|
||||
- name: Install qemu dependency
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y qemu-user-static
|
||||
|
||||
- name: Create Containerfile
|
||||
run: |
|
||||
cat > Containerfile<<EOF
|
||||
|
||||
FROM docker.io/alpine:3.16
|
||||
|
||||
RUN echo "hello world"
|
||||
|
||||
ENTRYPOINT [ "sh", "-c", "echo -n 'Machine: ' && uname -m && echo -n 'Bits: ' && getconf LONG_BIT && echo 'goodbye world'" ]
|
||||
EOF
|
||||
|
||||
- name: Build Image
|
||||
id: build_image_multiplatform
|
||||
uses: ./buildah-build/
|
||||
with:
|
||||
image: ${{ env.IMAGE_NAME }}
|
||||
tags: ${{ env.IMAGE_TAG }}
|
||||
platforms: linux/amd64, linux/ppc64le
|
||||
containerfiles: |
|
||||
./Containerfile
|
||||
|
||||
- name: Echo Outputs
|
||||
run: |
|
||||
echo "Image: ${{ steps.build_image_multiplatform.outputs.image }}"
|
||||
echo "Tags: ${{ steps.build_image_multiplatform.outputs.tags }}"
|
||||
echo "Tagged Image: ${{ steps.build_image_multiplatform.outputs.image-with-tag }}"
|
||||
|
||||
- name: Check images created
|
||||
run: buildah images | grep '${{ env.IMAGE_NAME }}'
|
||||
|
||||
- name: Check manifest
|
||||
run: |
|
||||
set -x
|
||||
buildah manifest inspect ${{ steps.build_image_multiplatform.outputs.image }}:${{ env.IMAGE_TAG }}
|
||||
|
||||
- name: Run image
|
||||
run: |
|
||||
podman run --rm ${{ steps.build_image_multiplatform.outputs.image }}:${{ env.IMAGE_TAG }}
|
||||
|
||||
build-multiarch-scratch:
|
||||
name: Build multi-architecture image from scratch
|
||||
env:
|
||||
IMAGE_NAME: spring-petclinic-multiarch
|
||||
runs-on: container
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
install_latest: [ false ]
|
||||
|
||||
steps:
|
||||
|
||||
# Checkout buildah action github repository
|
||||
- name: Checkout Buildah action
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: "buildah-build"
|
||||
|
||||
- name: Install latest buildah
|
||||
if: matrix.install_latest
|
||||
run: |
|
||||
bash buildah-build/.github/install_latest_buildah.sh
|
||||
|
||||
- name: Install qemu dependency
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y qemu-user-static
|
||||
|
||||
# Checkout spring-petclinic github repository
|
||||
- name: Checkout spring-petclinic project
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: "spring-projects/spring-petclinic"
|
||||
path: ${{ env.PROJECT_DIR }}
|
||||
|
||||
# Setup java.
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
cache: 'maven'
|
||||
|
||||
# Run maven to build the project
|
||||
- name: Maven
|
||||
working-directory: ${{ env.PROJECT_DIR }}
|
||||
run: |
|
||||
mvn package -ntp -B
|
||||
|
||||
- name: Build Image
|
||||
id: build_image_multiarch
|
||||
uses: ./buildah-build/
|
||||
with:
|
||||
image: ${{ env.IMAGE_NAME }}
|
||||
tags: ${{ env.IMAGE_TAG }}
|
||||
base-image: 'registry.access.redhat.com/openjdk/openjdk-11-rhel7'
|
||||
archs: amd64, i386, ppc64le
|
||||
# To avoid hardcoding a particular version of the binary.
|
||||
content: |
|
||||
./spring-petclinic/target/spring-petclinic-*.jar
|
||||
entrypoint: |
|
||||
java
|
||||
-jar
|
||||
spring-petclinic-*.jar
|
||||
port: 8080
|
||||
workdir: "."
|
||||
|
||||
- name: Echo Outputs
|
||||
run: |
|
||||
echo "Image: ${{ steps.build_image_multiarch.outputs.image }}"
|
||||
echo "Tags: ${{ steps.build_image_multiarch.outputs.tags }}"
|
||||
echo "Tagged Image: ${{ steps.build_image_multiarch.outputs.image-with-tag }}"
|
||||
|
||||
- name: Check images created
|
||||
run: buildah images | grep '${{ env.IMAGE_NAME }}'
|
||||
|
||||
- name: Check manifest
|
||||
run: |
|
||||
set -x
|
||||
buildah manifest inspect ${{ steps.build_image_multiarch.outputs.image }}:${{ env.IMAGE_TAG }}
|
Loading…
Add table
Add a link
Reference in a new issue