Compare commits
No commits in common. "eaa96d1d5bc711d23b0c60e4d7a34432b343d305" and "3dab7362399cc181d520f6bea9b2677492c41ab1" have entirely different histories.
eaa96d1d5b
...
3dab736239
|
@ -18,9 +18,6 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Get Git commit timestamps
|
|
||||||
run: echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Login to registry
|
- name: Login to registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
|
@ -58,13 +55,11 @@ jobs:
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
load: true
|
load: true
|
||||||
annotations: ${{ steps.meta.outputs.annotations }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
env:
|
|
||||||
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
|
|
||||||
|
|
||||||
- name: Generate CRDs
|
- name: Generate CRDs
|
||||||
run: |
|
run: |
|
||||||
docker run --rm ${{ steps.build.outputs.imageid }} /crdgen > ./manifests/crds.yaml
|
docker run --rm ${{ steps.build.outputs.imageid }} crdgen > ./manifests/crds.yaml
|
||||||
|
|
||||||
- name: Push container
|
- name: Push container
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
|
@ -72,12 +67,8 @@ jobs:
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
sbom: true
|
|
||||||
provenance: mode=max
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
annotations: ${{ steps.meta.outputs.annotations }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
env:
|
|
||||||
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
|
|
||||||
|
|
||||||
- name: Kustomize manifests
|
- name: Kustomize manifests
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -56,7 +56,7 @@ repos:
|
||||||
files: (\.rs|Cargo.lock)$
|
files: (\.rs|Cargo.lock)$
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
|
|
||||||
- repo: https://github.com/hadolint/hadolint
|
- repo: https://github.com/pryorda/dockerfilelint-precommit-hooks
|
||||||
rev: v2.12.0
|
rev: v0.1.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: hadolint
|
- id: dockerfilelint
|
||||||
|
|
27
Dockerfile
27
Dockerfile
|
@ -1,20 +1,9 @@
|
||||||
FROM rust:1.85 AS chef
|
FROM rust:1.85 AS builder
|
||||||
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
|
WORKDIR /usr/src/lldap-controller
|
||||||
RUN cargo install cargo-chef --locked --version 0.1.71
|
ADD . .
|
||||||
WORKDIR /app
|
RUN cargo install --path .
|
||||||
|
|
||||||
FROM chef AS planner
|
FROM debian:bookworm-slim
|
||||||
COPY . .
|
COPY --from=builder /usr/local/cargo/bin/lldap-controller /usr/local/bin/lldap-controller
|
||||||
RUN cargo chef prepare --recipe-path recipe.json
|
COPY --from=builder /usr/local/cargo/bin/crdgen /usr/local/bin/crdgen
|
||||||
|
CMD ["lldap-controller"]
|
||||||
FROM chef AS builder
|
|
||||||
COPY --from=planner /app/recipe.json recipe.json
|
|
||||||
RUN cargo chef cook --release --recipe-path recipe.json
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
RUN cargo build --release
|
|
||||||
|
|
||||||
FROM gcr.io/distroless/cc-debian12:nonroot AS runtime
|
|
||||||
COPY --from=builder /app/target/release/lldap-controller /lldap-controller
|
|
||||||
COPY --from=builder /app/target/release/crdgen /crdgen
|
|
||||||
CMD ["/lldap-controller"]
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user