Initial commit
Some checks failed
Multiarch build / Build multi-architecture image from scratch (push) Failing after 5s
Some checks failed
Multiarch build / Build multi-architecture image from scratch (push) Failing after 5s
Signed-off-by: Aleksander Cynarski <aleksander@cynarski.pl>
This commit is contained in:
parent
ec209d139d
commit
cafb1820a0
3
.gitea/install_latest_buildah.sh
Normal file
3
.gitea/install_latest_buildah.sh
Normal file
@ -0,0 +1,3 @@
|
||||
sudo apt-key add - < Release.key
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get -qq -y install buildah
|
65
.gitea/workflows/build.yml
Normal file
65
.gitea/workflows/build.yml
Normal file
@ -0,0 +1,65 @@
|
||||
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-scratch:
|
||||
name: Build multi-architecture image from scratch
|
||||
env:
|
||||
IMAGE_NAME: testing-multiarch
|
||||
DOCKER_DRIVER: overlay2
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
|
||||
# Checkout buildah action github repository
|
||||
- name: Checkout Buildah action
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install latest buildah
|
||||
run: |
|
||||
bash buildah-build/.gitea/install_latest_buildah.sh
|
||||
|
||||
- name: Install qemu dependency
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y qemu-user-static
|
||||
|
||||
- name: Build Image
|
||||
id: build_image_multiarch
|
||||
uses: redhat-actions/buildah-build@v2
|
||||
with:
|
||||
image: ${{ env.IMAGE_NAME }}
|
||||
tags: ${{ env.IMAGE_TAG }}
|
||||
base-image: 'registry.access.redhat.com/ubi9-minimal:9.5'
|
||||
archs: amd64, i386, ppc64le
|
||||
# To avoid hardcoding a particular version of the binary.
|
||||
containerfiles: |
|
||||
./Containerfile
|
||||
extra-args: |
|
||||
--isolation=chroot
|
||||
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 }}
|
5
Containerfile
Normal file
5
Containerfile
Normal file
@ -0,0 +1,5 @@
|
||||
FROM registry.access.redhat.com/ubi9-minimal:9.5
|
||||
|
||||
RUN yum install -y kubectl \
|
||||
&& yum clean all \
|
||||
&& rm -rf /var/cache/yum
|
Loading…
x
Reference in New Issue
Block a user