Skip to content

Build support container images #50

Build support container images

Build support container images #50

Workflow file for this run

name: supportimages
run-name: Build support container images
on: workflow_dispatch
env:
IMAGE_REGISTRY: "docker.io"
RUST_CI_VERSION: "1.72.0"
DEBIAN_VERSION: "bookworm"
GRUB_VERSION: "2.06"
ALPINE_VERSION: "3.18.3"
jobs:
build_publish_grub_image:
name: BUILDER GRUB
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare environment
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static podman buildah
sudo apt-get clean
- name: Build Linux builder images
shell: bash
run: |
cd ${{ github.workspace }}/ci_cd/support && buildah manifest create ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/grub:${{ env.GRUB_VERSION }}
cd ${{ github.workspace }}/ci_cd/support && buildah bud --squash --platform=linux/amd64 --format docker -t ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/grub:${{ env.GRUB_VERSION }}-amd64 -f Dockerfile.grub.amd64 .
buildah manifest add ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/grub:${{ env.GRUB_VERSION }} ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/grub:${{ env.GRUB_VERSION }}-amd64
cd ${{ github.workspace }}/ci_cd/support && buildah bud --squash --platform=linux/arm64 --format docker -t ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/grub:${{ env.GRUB_VERSION }}-arm64 -f Dockerfile.grub.arm64 .
buildah manifest add ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/grub:${{ env.GRUB_VERSION }} ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/grub:${{ env.GRUB_VERSION }}-arm64
- name: Publish Linux image
uses: redhat-actions/push-to-registry@v2
with:
image: grub
tags: ${{ env.GRUB_VERSION }}
registry: ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
extra-args: |
--format docker
build_publish_windows_images:
name: BUILDER WINDOWS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare environment
shell: bash
run: |
sudo apt-get update && sudo apt-get install -y qemu-user-static podman buildah && sudo apt-get clean
- name: Build Windows builder image
uses: redhat-actions/buildah-build@v2
with:
platforms: linux/amd64
image: ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/rust-windows
tags: ${{ env.RUST_CI_VERSION }}
oci: false
context: ci_cd/support
containerfiles: |
ci_cd/support/Dockerfile.windows.amd64
extra-args: |
--squash
- name: Publish Windows builder image
uses: redhat-actions/push-to-registry@v2
with:
image: rust-windows
tags: ${{ env.RUST_CI_VERSION }}
registry: ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
extra-args: |
--format docker
build_publish_macos_images:
name: BUILDER MACOS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Free space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: Prepare environment
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static podman buildah && sudo apt-get clean
- name: Build container builder image
uses: redhat-actions/buildah-build@v2
with:
platforms: linux/amd64, linux/arm64/v8
image: ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/rust-macos
tags: ${{ env.RUST_CI_VERSION }}
oci: false
context: ci_cd/support
containerfiles: |
ci_cd/support/Dockerfile.macos
extra-args: |
--squash
- name: Publish macos builder image
uses: redhat-actions/push-to-registry@v2
with:
image: rust-macos
tags: ${{ env.RUST_CI_VERSION }}
registry: ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
extra-args: |
--format docker
build_publish_alpine_builder_images:
name: BUILDER ALPINE
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup qemu
uses: docker/setup-qemu-action@v3
- name: Set up docker buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Alpine builder image
uses: docker/build-push-action@v5
with:
push: true
builder: ${{ steps.buildx.outputs.name }}
context: ${{ github.workspace }}/ci_cd/support
file: ${{ github.workspace }}/ci_cd/support/Dockerfile.alpine
platforms: linux/amd64, linux/arm64/v8
tags: ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/alpine:${{ env.ALPINE_VERSION }}
build_publish_container_builder_images:
name: BUILDER CONTAINER
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare environment
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static podman buildah
sudo apt-get clean
- name: Build container builder image
uses: redhat-actions/buildah-build@v2
with:
platforms: linux/amd64,linux/arm64/v8
image: ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/debian
tags: ${{ env.DEBIAN_VERSION }}-rust-${{ env.RUST_CI_VERSION }}-tesseract5
oci: false
context: ci_cd/support
containerfiles: |
ci_cd/support/Dockerfile.container.builder
extra-args: |
--squash
- name: Publish debian builder image
uses: redhat-actions/push-to-registry@v2
with:
image: debian
tags: ${{ env.DEBIAN_VERSION }}-rust-${{ env.RUST_CI_VERSION }}-tesseract5
registry: ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
extra-args: |
--format docker
build_publish_linux_images:
name: BUILDER LINUX
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare environment
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static podman buildah
sudo apt-get clean
- name: Build Linux builder images
shell: bash
run: |
cd ${{ github.workspace }}/ci_cd/support && buildah manifest create ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/rust-linux:${{ env.RUST_CI_VERSION }}
cd ${{ github.workspace }}/ci_cd/support && buildah bud --squash --platform=linux/amd64 --format docker -t ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/rust-linux:${{ env.RUST_CI_VERSION }}-amd64 -f Dockerfile.linux.amd64 .
buildah manifest add ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/rust-linux:${{ env.RUST_CI_VERSION }} ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/rust-linux:${{ env.RUST_CI_VERSION }}-amd64
cd ${{ github.workspace }}/ci_cd/support && buildah bud --squash --platform=linux/arm64 --format docker -t ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/rust-linux:${{ env.RUST_CI_VERSION }}-arm64 -f Dockerfile.linux.arm64 .
buildah manifest add ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/rust-linux:${{ env.RUST_CI_VERSION }} ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/rust-linux:${{ env.RUST_CI_VERSION }}-arm64
- name: Publish Linux image
uses: redhat-actions/push-to-registry@v2
with:
image: rust-linux
tags: ${{ env.RUST_CI_VERSION }}
registry: ${{ env.IMAGE_REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
extra-args: |
--format docker