Skip to content

Commit 63f0194

Browse files
committed
Build container using buildah
1 parent 3dbc7d5 commit 63f0194

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

.github/workflows/build.yml

+32
Original file line numberDiff line numberDiff line change
@@ -301,3 +301,35 @@ jobs:
301301
files: laurel-*.tar.gz
302302
fail_on_unmatched_files: true
303303
draft: true
304+
305+
build-container:
306+
runs-on: ubuntu-latest
307+
needs:
308+
- build-x86_64-musl
309+
steps:
310+
- uses: actions/checkout@v4
311+
- uses: actions/download-artifact@v4
312+
with:
313+
merge-multiple: true
314+
path: target
315+
- name: Edit configuration
316+
run: |
317+
sed -e 's#^input = .*#input = "unix:/var/run/audispd_events"#' etc/laurel/config.toml
318+
- uses: redhat-actions/buildah-build@v2
319+
id: build-image
320+
with:
321+
image: laurel
322+
tags: "latest ${{ github.ref_name }} ${{ github.sha }}"
323+
containerfiles: ./Containerfile
324+
- uses: redhat-actions/podman-login@v1
325+
if: ${{ github.ref_type == 'tag' }}
326+
with:
327+
registry: ghcr.io
328+
username: ${{ github.actor }}
329+
password: ${{ secrets.GITHUB_TOKEN }}
330+
- uses: redhat-actions/push-to-registry@v2
331+
if: ${{ github.ref_type == 'tag' }}
332+
with:
333+
registry: ghcr.io/${{ github.repository_owner }}
334+
image: ${{ steps.build-image.outputs.image }}
335+
tags: ${{ steps.build-image.outputs.tags }}

Dockerfile Containerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
FROM gcr.io/distroless/static-debian11
1+
FROM gcr.io/distroless/static-debian12
22

3-
COPY laurel /usr/bin/laurel
3+
COPY target/x86_64-alpine-linux-musl/release/laurel /usr/bin/laurel
44
COPY etc/laurel/config.toml /etc/laurel/config.toml
5+
56
ENTRYPOINT ["/usr/bin/laurel"]
67
CMD ["--config", "/etc/laurel/config.toml"]

0 commit comments

Comments
 (0)