Skip to content

donotmerge: IBX changes #958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ target
# These directories don't contribute to our container build
docs/
plans/
Containerfile
build_seed.sh
31 changes: 31 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM quay.io/centos/centos:stream9 as build
COPY hack/build.sh /build.sh
COPY ./contrib/packaging/bootc.spec ./contrib/packaging/bootc.spec
RUN /build.sh && rm -v /build.sh
COPY . /build
WORKDIR /build
RUN mkdir -p /build/target/dev-rootfs # This can hold arbitrary extra content
# See https://www.reddit.com/r/rust/comments/126xeyx/exploring_the_problem_of_faster_cargo_docker/
# We aren't using the full recommendations there, just the simple bits.
RUN --mount=type=cache,target=/build/target --mount=type=cache,target=/var/roothome make test-bin-archive && mkdir -p /out && cp target/bootc.tar /out
RUN mkdir -p /build/target/dev-rootfs # This can hold arbitrary extra content

FROM quay.io/otuchfel/bootc:seed30 as seed

# ____________________________________________________________________________

FROM quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:66b5f9d8f1af5acee783db84a25c08338252ff9c276d33e391680168a22f42ee


LABEL com.openshift.lifecycle-agent.seed_format_version=4

RUN mkdir -p /usr/lib/bootc/install

COPY --from=seed --exclude=ostree.tgz / /usr/lib/openshift/seed

COPY --from=build /out/bootc.tar /tmp

COPY baseimage/base/usr/lib/ostree/prepare-root.conf /usr/lib/ostree/prepare-root.conf

RUN tar -C / -xvf /tmp/bootc.tar && rm -vrf /tmp/*
RUN sed -i '/PermitRootLogin no/d' /etc/ssh/sshd_config.d/40-rhcos-defaults.conf
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ install-all: install install-ostree-hooks
install -D -m 0755 target/release/tests-integration $(DESTDIR)$(prefix)/bin/bootc-integration-tests

bin-archive: all
$(MAKE) install DESTDIR=tmp-install && $(TAR_REPRODUCIBLE) --zstd -C tmp-install -cf target/bootc.tar.zst . && rm tmp-install -rf
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-zstd unsupported on quay.io/centos/centos:stream9

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait that's definitely not true. Do you have a really old image? Builds don't pull by default so unfortunately you need to explicitly e.g. podman pull quay.io/centos-bootc/centos-bootc:stream9 or so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe I have an old image

$(MAKE) install DESTDIR=tmp-install && $(TAR_REPRODUCIBLE) -C tmp-install -cf target/bootc.tar . && rm tmp-install -rf

test-bin-archive: all
$(MAKE) install-all DESTDIR=tmp-install && $(TAR_REPRODUCIBLE) --zstd -C tmp-install -cf target/bootc.tar.zst . && rm tmp-install -rf
$(MAKE) install-all DESTDIR=tmp-install && $(TAR_REPRODUCIBLE) -C tmp-install -cf target/bootc.tar . && rm tmp-install -rf

test-tmt:
cargo xtask test-tmt
Expand Down
11 changes: 11 additions & 0 deletions build_seed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

SCRIPT_DIR=$(dirname $0)

set -euxo pipefail

cd $SCRIPT_DIR

podman build -t bootcseed -f Containerfile .
podman tag bootcseed:latest quay.io/otuchfel/bootc:seed61
podman push quay.io/otuchfel/bootc:seed61
6 changes: 3 additions & 3 deletions hack/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ WORKDIR /build
RUN mkdir -p /build/target/dev-rootfs # This can hold arbitrary extra content
# See https://www.reddit.com/r/rust/comments/126xeyx/exploring_the_problem_of_faster_cargo_docker/
# We aren't using the full recommendations there, just the simple bits.
RUN --mount=type=cache,target=/build/target --mount=type=cache,target=/var/roothome make test-bin-archive && mkdir -p /out && cp target/bootc.tar.zst /out
RUN --mount=type=cache,target=/build/target --mount=type=cache,target=/var/roothome make test-bin-archive && mkdir -p /out && cp target/bootc.tar /out

FROM $base
# We support e.g. adding cloud-init
Expand All @@ -29,8 +29,8 @@ COPY hack/install-test-configs/* /usr/lib/bootc/install/
# And some test kargs
COPY hack/test-kargs /usr/lib/bootc/kargs.d/
# Inject our built code
COPY --from=build /out/bootc.tar.zst /tmp
RUN tar -C / --zstd -xvf /tmp/bootc.tar.zst && rm -vrf /tmp/*
COPY --from=build /out/bootc.tar /tmp
RUN tar -C / -xvf /tmp/bootc.tar && rm -vrf /tmp/*
# Also copy over arbitrary bits from the target root
COPY --from=build /build/target/dev-rootfs/ /
# Test our own linting
Expand Down
Loading