mirror of
https://github.com/falcosecurity/falco.git
synced 2025-10-21 11:29:26 +00:00
95 lines
4.4 KiB
YAML
95 lines
4.4 KiB
YAML
# This is a reusable workflow used by master and release CI
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
arch:
|
|
description: x86_64 or aarch64
|
|
required: true
|
|
type: string
|
|
bucket_suffix:
|
|
description: bucket suffix for packages
|
|
required: false
|
|
default: ''
|
|
type: string
|
|
version:
|
|
description: The Falco version to use when building images
|
|
required: true
|
|
type: string
|
|
tag:
|
|
description: The tag to use (e.g. "master" or "0.35.0")
|
|
required: true
|
|
type: string
|
|
|
|
# Here we just build all docker images as tarballs,
|
|
# then we upload all the tarballs to be later downloaded by reusable_publish_docker workflow.
|
|
# In this way, we don't need to publish any arch specific image,
|
|
# and this "build" workflow is actually only building images.
|
|
jobs:
|
|
build-docker:
|
|
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
|
|
runs-on: ${{ (inputs.arch == 'aarch64' && fromJSON('[ "self-hosted", "linux", "ARM64" ]')) || 'ubuntu-latest' }}
|
|
env:
|
|
TARGETARCH: ${{ (inputs.arch == 'aarch64' && 'arm64') || 'amd64' }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
|
|
|
|
- name: Build no-driver image
|
|
run: |
|
|
cd ${{ github.workspace }}/docker/no-driver/
|
|
docker build -t docker.io/falcosecurity/falco-no-driver:${{ inputs.arch }}-${{ inputs.tag }} \
|
|
--build-arg VERSION_BUCKET=bin${{ inputs.bucket_suffix }} \
|
|
--build-arg FALCO_VERSION=${{ inputs.version }} \
|
|
--build-arg TARGETARCH=${TARGETARCH} \
|
|
.
|
|
docker save docker.io/falcosecurity/falco-no-driver:${{ inputs.arch }}-${{ inputs.tag }} --output /tmp/falco-no-driver-${{ inputs.arch }}.tar
|
|
|
|
- name: Build distroless image
|
|
run: |
|
|
cd ${{ github.workspace }}/docker/no-driver/
|
|
docker build -f Dockerfile.distroless -t docker.io/falcosecurity/falco-distroless:${{ inputs.arch }}-${{ inputs.tag }} \
|
|
--build-arg VERSION_BUCKET=bin${{ inputs.bucket_suffix }} \
|
|
--build-arg FALCO_VERSION=${{ inputs.version }} \
|
|
--build-arg TARGETARCH=${TARGETARCH} \
|
|
.
|
|
docker save docker.io/falcosecurity/falco-distroless:${{ inputs.arch }}-${{ inputs.tag }} --output /tmp/falco-distroless-${{ inputs.arch }}.tar
|
|
|
|
- name: Build falco image
|
|
run: |
|
|
cd ${{ github.workspace }}/docker/falco/
|
|
docker build -t docker.io/falcosecurity/falco:${{ inputs.arch }}-${{ inputs.tag }} \
|
|
--build-arg VERSION_BUCKET=deb${{ inputs.bucket_suffix }} \
|
|
--build-arg FALCO_VERSION=${{ inputs.version }} \
|
|
--build-arg TARGETARCH=${TARGETARCH} \
|
|
.
|
|
docker save docker.io/falcosecurity/falco:${{ inputs.arch }}-${{ inputs.tag }} --output /tmp/falco-${{ inputs.arch }}.tar
|
|
|
|
- name: Build falco-driver-loader image
|
|
run: |
|
|
cd ${{ github.workspace }}/docker/driver-loader/
|
|
docker build -t docker.io/falcosecurity/falco-driver-loader:${{ inputs.arch }}-${{ inputs.tag }} \
|
|
--build-arg FALCO_IMAGE_TAG=${{ inputs.arch }}-${{ inputs.tag }} \
|
|
--build-arg TARGETARCH=${TARGETARCH} \
|
|
.
|
|
docker save docker.io/falcosecurity/falco-driver-loader:${{ inputs.arch }}-${{ inputs.tag }} --output /tmp/falco-driver-loader-${{ inputs.arch }}.tar
|
|
|
|
- name: Build falco-driver-loader-legacy image
|
|
run: |
|
|
cd ${{ github.workspace }}/docker/driver-loader-legacy/
|
|
docker build -t docker.io/falcosecurity/falco-driver-loader-legacy:${{ inputs.arch }}-${{ inputs.tag }} \
|
|
--build-arg VERSION_BUCKET=deb${{ inputs.bucket_suffix }} \
|
|
--build-arg FALCO_VERSION=${{ inputs.version }} \
|
|
--build-arg TARGETARCH=${TARGETARCH} \
|
|
.
|
|
docker save docker.io/falcosecurity/falco-driver-loader-legacy:${{ inputs.arch }}-${{ inputs.tag }} --output /tmp/falco-driver-loader-legacy-${{ inputs.arch }}.tar
|
|
|
|
- name: Upload images tarballs
|
|
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
|
with:
|
|
name: falco-images
|
|
path: /tmp/falco-*.tar
|
|
retention-days: 1
|