From f46f5847a19017da43f78e23685df1c0f6995424 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Wed, 26 Jun 2024 14:18:04 -0700 Subject: [PATCH] feat(images): add dockerfiles for the OCI distributions of krata components Signed-off-by: Ariadne Conill --- images/Dockerfile.kratactl | 12 ++++++++++++ images/Dockerfile.kratad | 13 +++++++++++++ images/Dockerfile.kratanet | 13 +++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 images/Dockerfile.kratactl create mode 100644 images/Dockerfile.kratad create mode 100644 images/Dockerfile.kratanet diff --git a/images/Dockerfile.kratactl b/images/Dockerfile.kratactl new file mode 100644 index 0000000..cb944ba --- /dev/null +++ b/images/Dockerfile.kratactl @@ -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 diff --git a/images/Dockerfile.kratad b/images/Dockerfile.kratad new file mode 100644 index 0000000..66fa0b6 --- /dev/null +++ b/images/Dockerfile.kratad @@ -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 diff --git a/images/Dockerfile.kratanet b/images/Dockerfile.kratanet new file mode 100644 index 0000000..f3827f8 --- /dev/null +++ b/images/Dockerfile.kratanet @@ -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