Skip to content

Commit

Permalink
build minio with apko
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh committed Dec 8, 2023
1 parent 97a7a77 commit 00939d4
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 8 deletions.
28 changes: 28 additions & 0 deletions .github/actions/build-push-minio-image/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Build and push minio image'
description: 'Composite action for building and pushing minio image'
inputs:
image-name:
description: 'Full destination minio image name'
required: true

registry-username:
description: 'Username to login to registry'
default: ''
required: false

registry-password:
description: 'Password to login to registry'
default: ''
required: false

runs:
using: "composite"
steps:
- uses: chainguard-images/actions/apko-publish@main
with:
config: deploy/minio/apko.yaml
archs: x86_64
tag: ${{ inputs.image-name }}
vcs-url: true
generic-user: ${{ inputs.registry-username }}
generic-pass: ${{ inputs.registry-password }}
27 changes: 24 additions & 3 deletions .github/workflows/alpha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,30 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Read image tags from env file
uses: falti/dotenv-action@v1
id: dotenv
with:
path: .image.env
- uses: ./.github/actions/build-push-rqlite-image
with:
image-name: index.docker.io/kotsadm/rqlite:alpha
image-name: index.docker.io/kotsadm/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }}
registry-username: ${{ secrets.DOCKERHUB_USER }}
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}


build-minio:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Read image tags from env file
uses: falti/dotenv-action@v1
id: dotenv
with:
path: .image.env
- uses: ./.github/actions/build-push-minio-image
with:
image-name: index.docker.io/kotsadm/minio:${{ steps.dotenv.outputs.MINIO_TAG }}
registry-username: ${{ secrets.DOCKERHUB_USER }}
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}

Expand Down Expand Up @@ -95,7 +116,7 @@ jobs:
id: scan
uses: aquasecurity/trivy-action@master
with:
image-ref: "rqlite/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }}"
image-ref: "docker.io/kotsadm/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }}"
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'rqlite-scan-output.sarif'
Expand All @@ -122,7 +143,7 @@ jobs:
id: scan
uses: aquasecurity/trivy-action@master
with:
image-ref: "minio/minio:${{ steps.dotenv.outputs.minio_tag }}"
image-ref: "docker.io/kotsadm/minio:${{ steps.dotenv.outputs.MINIO_TAG }}"
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'minio-scan-output.sarif'
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,9 @@ jobs:
with:
path: .image.env

- name: push minio for e2e
run: |
docker pull minio/minio:${{ steps.dotenv.outputs.minio_tag }}
docker tag minio/minio:${{ steps.dotenv.outputs.minio_tag }} ttl.sh/automated-${{ github.run_id }}/minio:${{ steps.dotenv.outputs.minio_tag }}
docker push ttl.sh/automated-${{ github.run_id }}/minio:${{ steps.dotenv.outputs.minio_tag }}
- uses: ./.github/actions/build-push-minio-image
with:
image-name: ttl.sh/automated-${{ github.run_id }}/minio:${{ steps.dotenv.outputs.minio_tag }}


push-rqlite:
Expand Down
2 changes: 2 additions & 0 deletions deploy/kurl/kotsadm/template/base/rqlite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ spec:
ports:
- name: rqlite
containerPort: 4001
- name: raft
containerPort: 4002
volumeMounts:
- name: kotsadm-rqlite
mountPath: /rqlite/file
Expand Down
28 changes: 28 additions & 0 deletions deploy/minio/apko.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
contents:
repositories:
- https://packages.wolfi.dev/os
keyring:
- https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
packages:
- minio
- mc
- bash
- busybox
- wolfi-baselayout

accounts:
groups:
- groupname: minio
gid: 1001
users:
- username: minio
uid: 1001
gid: 1001
run-as: minio

entrypoint:
command: minio

archs:
- x86_64
- aarch64

0 comments on commit 00939d4

Please sign in to comment.