Skip to content

Commit

Permalink
feat: add fedora rpmbuild base
Browse files Browse the repository at this point in the history
fedora build for pi
  • Loading branch information
Mossman1215 committed Oct 31, 2023
1 parent d931461 commit 9dc429d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
outputs:
matrix-docker: ${{ steps.set.outputs.matrix-docker }}
matrix-apko: ${{ steps.set.outputs.matrix-apko }}
matrix-arm: ${{ steps.set.outputs.matrix-arm }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- id: set
Expand All @@ -33,10 +34,12 @@ jobs:
run: |
echo "matrix-docker=$(jq --arg REF "$REF" -rMc '.build[] | select(.source | contains("Dockerfile")) | select(.buildOnMainOnly == null or $REF == "refs/heads/main") | . as $config | .destination | capture("(?<registry>.*)/(?<imageName>.*):(?<tag>.*)") | . as $imgSplit | $config | .source | capture("(?<context>.*)/Dockerfile") | . as $context | $config + $imgSplit + $context' -r -c <<< "$(yq e . -o json config.yaml)" | jq -rcsM '{"include":.}')" >> $GITHUB_OUTPUT
echo "matrix-apko=$(jq -rMc '.build[] | select(.source | contains("image.yaml"))' -r -c <<< "$(yq e . -o json config.yaml)" | jq -rcsM '{"include":.}')" >> $GITHUB_OUTPUT
echo "matrix-arm=$(jq --arg REF "$REF" -rMc '.build[] | select(.source | contains("Dockerfile")) | select(.buildOnArm == true) | . as $config | .destination | capture("(?<registry>.*)/(?<imageName>.*):(?<tag>.*)") | . as $imgSplit | $config | .source | capture("(?<context>.*)/Dockerfile") | . as $context | $config + $imgSplit + $context' -r -c <<< "$(yq e . -o json config.yaml)" | jq -rcsM '{"include":.}')" >> $GITHUB_OUTPUT
- name: check output
run: |
jq . <<< '${{ steps.set.outputs.matrix-docker }}'
jq . <<< '${{ steps.set.outputs.matrix-apko }}'
jq . <<< '${{ steps.set.outputs.matrix-arm }}'
build-docker:
needs: prepare
if: fromJSON(needs.prepare.outputs.matrix-docker) != null
Expand All @@ -51,6 +54,20 @@ jobs:
tags: ${{ fromJSON(toJSON(matrix)).tag }}
platforms: linux/amd64
push: ${{ github.ref == 'refs/heads/main' }}
build-arm64:
needs: prepare
if: fromJSON(needs.prepare.outputs.matrix-arm) != null
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prepare.outputs.matrix-arm) }}
uses: GeoNet/Actions/.github/workflows/reusable-docker-build.yml@main
with:
context: ${{ fromJSON(toJSON(matrix)).context }}
dockerfile: ${{ fromJSON(toJSON(matrix)).source }}
imageName: ${{ fromJSON(toJSON(matrix)).imageName }}
tags: ${{ fromJSON(toJSON(matrix)).tag }}
platforms: linux/arm64
push: ${{ github.ref == 'refs/heads/main' }}
build-apko:
needs: prepare
if: fromJSON(needs.prepare.outputs.matrix-apko) != null
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The repo is mostly concerned with base images or images used in build processes.
list of vendored base images

| Image | Description |
|-----------------------------------------------------------------|--------------------------------------------------------------------------------|
| --------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| ghcr.io/geonet/base-images/alpine | standard Alpine base image |
| ghcr.io/geonet/base-images/datadog/agent | datadog agent |
| ghcr.io/geonet/base-images/debian | standard Debian slim image |
Expand Down Expand Up @@ -73,6 +73,7 @@ list of vendored base images
| ghcr.io/geonet/base-images/rpmbuild-centos7 | image for building RPMs with, based on CentOS 7 |
| ghcr.io/geonet/base-images/rpmbuild-centos-stream8 | image for building RPMs with, based on CentOS Stream 8 |
| ghcr.io/geonet/base-images/rpmbuild-centos-stream9 | image for building RPMs with, based on CentOS Stream 9 |
| ghcr.io/geonet/base-images/rpmbuild-fedora | image for building RPMs with, based on fedora38 |
| ghcr.io/geonet/base-images/yq | yq for GitHub actions |
| ghcr.io/geonet/base-images/binfmt | Cross-platform emulator collection distributed with Docker images |
| 862640294325.dkr.ecr.ap-southeast-2.amazonaws.com/datadog-agent | datadog agent for use in ECS |
Expand Down Expand Up @@ -331,16 +332,16 @@ PACKAGE: <nil>

# Tooling

| Name | Description | Links | Related/Alternatives |
|---------|-------------------------------------------------------------------------------|--------------------------------------------------------------------|------------------------------------------|
| crane | an officially supported cli container registry tool from Google | <https://github.com/google/go-containerregistry/tree/main/cmd/crane> | skopeo |
| yq | a cli YAML parser | <https://github.com/mikefarah/yq> | jq |
| cosign | a cli container image artifact signing utility by Sigstore (Linux Foundation) | <https://github.com/sigstore/cosign> | ... |
| melange | a cli Alpine APK package declarative builder supported by Chainguard | <https://github.com/chainguard-dev/melange> | ... |
| Name | Description | Links | Related/Alternatives |
| ------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------------------ |
| crane | an officially supported cli container registry tool from Google | <https://github.com/google/go-containerregistry/tree/main/cmd/crane> | skopeo |
| yq | a cli YAML parser | <https://github.com/mikefarah/yq> | jq |
| cosign | a cli container image artifact signing utility by Sigstore (Linux Foundation) | <https://github.com/sigstore/cosign> | ... |
| melange | a cli Alpine APK package declarative builder supported by Chainguard | <https://github.com/chainguard-dev/melange> | ... |
| apko | a cli tool for declaratively building Alpine based container images | <https://github.com/chainguard-dev/apko> | ko (<https://ko.build> - Linux Foundation) |
| docker | a container ecosystem, primarily for development | <https://docker.io> | podman |
| trivy | a container image scanner | <https://github.com/aquasecurity/trivy> | clair |
| syft | a cli tool to generate sboms based on container images and filesystems | <https://github.com/anchore/syft> | |
| docker | a container ecosystem, primarily for development | <https://docker.io> | podman |
| trivy | a container image scanner | <https://github.com/aquasecurity/trivy> | clair |
| syft | a cli tool to generate sboms based on container images and filesystems | <https://github.com/anchore/syft> | |

# Patterns for discussion

Expand Down
4 changes: 4 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,7 @@ build:
- source: ./images/rpmbuild-centos-stream9/Dockerfile
destination: ghcr.io/geonet/base-images/rpmbuild-centos-stream9:latest
buildOnMainOnly: true
- source: ./images/rpmbuild-fedora/Dockerfile
destination: ghcr.io/geonet/base-images/rpmbuild-fedora:latest
buildOnMainOnly: true
buildOnArm: true
6 changes: 6 additions & 0 deletions images/rpmbuild-fedora/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM ghcr.io/geonet/base-images/fedora:38
# Installing tools needed for rpmbuild
RUN dnf update -y && \
dnf install -y \
rpm-build rpmdevtools rpm-sign rpmlint git dnf-plugins-core nodejs npm make automake gcc \
gcc-c++ kernel-devel python3 glibc systemd openssl fontconfig-devel freetype freetype-devel boost

0 comments on commit 9dc429d

Please sign in to comment.