mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-02 21:00:55 +00:00
OCI distribution (#210)
* feat(images): add dockerfiles for the OCI distributions of krata components Signed-off-by: Ariadne Conill <ariadne@dereferenced.org> * feat(images): add oci distribution workflow Signed-off-by: Ariadne Conill <ariadne@dereferenced.org> --------- Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
This commit is contained in:
parent
8ddc190018
commit
8363ed0085
47
.github/workflows/oci-distribution.yml
vendored
Normal file
47
.github/workflows/oci-distribution.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
name: OCI distribution
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 10 * * *"
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
id-token: write
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
component:
|
||||||
|
- kratactl
|
||||||
|
- kratad
|
||||||
|
- kratanet
|
||||||
|
name: OCI build ${{ matrix.component }} on ${{ matrix.platform }}
|
||||||
|
steps:
|
||||||
|
- uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
|
||||||
|
with:
|
||||||
|
egress-policy: audit
|
||||||
|
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0
|
||||||
|
- uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
|
||||||
|
- uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0
|
||||||
|
id: push-step
|
||||||
|
with:
|
||||||
|
file: ./images/Dockerfile.${{ matrix.component }}
|
||||||
|
platforms: linux/amd64,linux/aarch64
|
||||||
|
tags: ghcr.io/edera-dev/${{ matrix.component }}:nightly
|
||||||
|
push: true
|
||||||
|
- name: Sign the image
|
||||||
|
env:
|
||||||
|
DIGEST: ${{ steps.push-step.outputs.digest }}
|
||||||
|
TAGS: ghcr.io/edera-dev/${{ matrix.component }}:nightly
|
||||||
|
COSIGN_EXPERIMENTAL: "true"
|
||||||
|
run: cosign sign --yes "${TAGS}@${DIGEST}"
|
12
images/Dockerfile.kratactl
Normal file
12
images/Dockerfile.kratactl
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
FROM rust:1.79-alpine AS build
|
||||||
|
RUN apk update && apk add protoc protobuf-dev build-base && rm -rf /var/cache/apk/*
|
||||||
|
ENV TARGET_LIBC=musl TARGET_VENDOR=unknown
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
COPY . .
|
||||||
|
RUN ./hack/build/cargo.sh build --release --bin kratactl
|
||||||
|
RUN mv ./target/$(./hack/build/target.sh)/release/kratactl /usr/sbin
|
||||||
|
|
||||||
|
FROM cgr.dev/chainguard/static AS final
|
||||||
|
ENTRYPOINT ["/usr/sbin/kratactl"]
|
||||||
|
COPY --from=build /usr/sbin/kratactl /usr/sbin/kratactl
|
13
images/Dockerfile.kratad
Normal file
13
images/Dockerfile.kratad
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
FROM rust:1.79-alpine AS build
|
||||||
|
RUN apk update && apk add protoc protobuf-dev build-base && rm -rf /var/cache/apk/*
|
||||||
|
ENV TARGET_LIBC=musl TARGET_VENDOR=unknown
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
COPY . .
|
||||||
|
RUN ./hack/build/cargo.sh build --release --bin kratad
|
||||||
|
RUN mv ./target/$(./hack/build/target.sh)/release/kratad /usr/sbin
|
||||||
|
|
||||||
|
FROM cgr.dev/chainguard/static AS final
|
||||||
|
ENTRYPOINT ["/usr/sbin/kratad"]
|
||||||
|
COPY --from=build /usr/sbin/kratad /usr/sbin/kratad
|
||||||
|
COPY ./resources/systemd/kratad.service /usr/lib/systemd/system/kratad.service
|
13
images/Dockerfile.kratanet
Normal file
13
images/Dockerfile.kratanet
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
FROM rust:1.79-alpine AS build
|
||||||
|
RUN apk update && apk add protoc protobuf-dev build-base && rm -rf /var/cache/apk/*
|
||||||
|
ENV TARGET_LIBC=musl TARGET_VENDOR=unknown
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
COPY . .
|
||||||
|
RUN ./hack/build/cargo.sh build --release --bin kratanet
|
||||||
|
RUN mv ./target/$(./hack/build/target.sh)/release/kratanet /usr/sbin
|
||||||
|
|
||||||
|
FROM cgr.dev/chainguard/static AS final
|
||||||
|
ENTRYPOINT ["/usr/sbin/kratanet"]
|
||||||
|
COPY --from=build /usr/sbin/kratanet /usr/sbin/kratanet
|
||||||
|
COPY ./resources/systemd/kratanet.service /usr/lib/systemd/system/kratanet.service
|
Loading…
Reference in New Issue
Block a user