Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
FROM quay.io/fedora/fedora-minimal:44 AS buildroot
ARG DNF_FLAGS="-y --setopt=install_weak_deps=False"
ARG GO_BUILDER_IMAGE=quay.io/hummingbird/go:1.26.8-builder
ARG CORE_RUNTIME_IMAGE=quay.io/hummingbird/core-runtime:2.43


FROM ${GO_BUILDER_IMAGE} AS deps
# We pull required dependencies and overlay them
# on top of the runtime image
ARG DNF_FLAGS="-y --setopt=install_weak_deps=False --nodocs"
RUN --mount=type=cache,id=dnf,target=/var/cache/libdnf5 \
dnf install ${DNF_FLAGS} golang
mkdir -p /staged &&\
dnf install -y \
--use-host-config \
--installroot=/staged \
util-linux-core && \
# Remove metadata and manpages
rm -rf /staged/var/lib/dnf \
/staged/var/log/* \
/staged/var/lib/rpm \
/staged/usr/share/{man,doc,locale}

FROM ${GO_BUILDER_IMAGE} AS builder

FROM buildroot as builder
ARG VERSION=dev
ARG GIT_COMMIT=unknown
WORKDIR /workspace
Expand All @@ -17,7 +33,8 @@ RUN --mount=type=cache,id=gomod,target=/root/go/pkg/mod \
go build -ldflags "${LDFLAGS}" -o manager ./cmd/controller/ && \
go build -ldflags "${LDFLAGS}" -o daemon ./cmd/daemon/

FROM quay.io/fedora/fedora-minimal:44
FROM ${CORE_RUNTIME_IMAGE}
COPY --from=deps /staged/usr /usr
COPY --from=builder /workspace/manager /workspace/daemon /usr/local/bin/
USER 65532:65532
ENTRYPOINT ["manager"]
Loading