Skip to content

Commit d4eedb3

Browse files
committed
Containerfile : install util-linux-core in runtime
The `nsenter` binary is required as it's called before calling `bootc status`. Let's install the RPM that ships it into the runtime image. This is not great as it pulls a lot of dependencies, so later on we should probably do that in go. Also make the containerfile use build args so we can use overrides to pul the hummingbird images from another repo Signed-off-by: jbtrystram <jbtrystram@redhat.com>
1 parent 8ea3aaf commit d4eedb3

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

Containerfile

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
1-
FROM quay.io/hummingbird/go AS builder
1+
ARG GO_BUILDER_IMAGE=quay.io/hummingbird/go:latest-builder
2+
ARG CORE_RUNTIME_IMAGE=quay.io/hummingbird/core-runtime:latest
3+
4+
5+
FROM ${GO_BUILDER_IMAGE} AS deps
6+
# We pull required dependencies and overlay them
7+
# on top of the runtime image
8+
ARG DNF_FLAGS="-y --setopt=install_weak_deps=False --nodocs"
9+
RUN --mount=type=cache,id=dnf,target=/var/cache/libdnf5 \
10+
mkdir -p /staged &&\
11+
dnf install -y \
12+
--use-host-config \
13+
--installroot=/staged \
14+
util-linux-core && \
15+
# Remove metadata and manpages
16+
rm -rf /staged/var/lib/dnf \
17+
/staged/var/log/* \
18+
/staged/var/lib/rpm \
19+
/staged/usr/share/{man,doc,locale}
20+
21+
FROM ${GO_BUILDER_IMAGE} AS builder
222

323
ARG VERSION=dev
424
ARG GIT_COMMIT=unknown
@@ -13,7 +33,8 @@ RUN --mount=type=cache,id=gomod,target=/root/go/pkg/mod \
1333
go build -ldflags "${LDFLAGS}" -o manager ./cmd/controller/ && \
1434
go build -ldflags "${LDFLAGS}" -o daemon ./cmd/daemon/
1535

16-
FROM quay.io/hummingbird/core-runtime:latest
36+
FROM ${CORE_RUNTIME_IMAGE}
37+
COPY --from=deps /staged/usr /usr
1738
COPY --from=builder /workspace/manager /workspace/daemon /usr/local/bin/
1839
USER 65532:65532
1940
ENTRYPOINT ["manager"]

0 commit comments

Comments
 (0)