diff --git a/Dockerfile.buildroot b/Dockerfile.buildroot new file mode 100644 index 0000000000..98581bae97 --- /dev/null +++ b/Dockerfile.buildroot @@ -0,0 +1,15 @@ +# This layers on top of the primary cosa container, and includes +# the build dependencies for some key packages such as +# ignition, rpm-ostree, libpod, systemd, and kernel. If you want +# another package in this list, submit a PR and we can probably add it. +# +# Further, the entrypoint is reset to bash, and the user to root, making +# this container easier to use generically. For example, the rpm-ostree +# CI system will likely use this as a base image. +FROM quay.io/coreos-assembler/coreos-assembler:latest +USER root +ENTRYPOINT ["/usr/bin/bash"] +WORKDIR /root/containerbuild +COPY src src +RUN ./src/install-buildroot.sh && yum clean all && rm src -rf +WORKDIR /root diff --git a/src/buildroot-buildreqs.txt b/src/buildroot-buildreqs.txt new file mode 100644 index 0000000000..35fc6f340c --- /dev/null +++ b/src/buildroot-buildreqs.txt @@ -0,0 +1,9 @@ +# This is what the CoreOS developers tend to actively develop/own. +# If you want to extend this, feel free to file a PR. +ignition +ostree +rpm-ostree +kernel +systemd +dracut +podman diff --git a/src/buildroot-reqs.txt b/src/buildroot-reqs.txt new file mode 100644 index 0000000000..72ac32483b --- /dev/null +++ b/src/buildroot-reqs.txt @@ -0,0 +1,29 @@ +# This is a list of basic buildrequires; it'd be a bit better to +# yum -y install @buildsys-build but unfortunately that hits a bug: +# https://fedoraproject.org/wiki/Common_F30_bugs#Conflicts_between_fedora-release_packages_when_installing_package_groups +# So here we inline it, minus the -release package. +bash +bzip2 +coreutils +cpio +diffutils +findutils +gawk +glibc-minimal-langpack +grep +gzip +info +make +patch +redhat-rpm-config +rpm-build +sed +shadow-utils +tar +unzip +util-linux +which +xz + +# Also, add clang since it's useful at least in CI for C/C++ projects +clang diff --git a/src/install-buildroot.sh b/src/install-buildroot.sh new file mode 100755 index 0000000000..96cf5ccc23 --- /dev/null +++ b/src/install-buildroot.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# This is invoked by Dockerfile.buildroot +set -euo pipefail +dn=$(dirname "$0") +deps=$(grep -v '^#' "${dn}"/buildroot-reqs.txt) +echo "Installing requirements" +echo "${deps}" | xargs yum -y install +brs=$(grep -v '^#' "${dn}"/buildroot-buildreqs.txt) +echo "Installing build dependencies of primary packages" +echo "${brs}" | xargs yum -y builddep +echo 'Done!'