Skip to content
Open
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
14 changes: 14 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ variable "DISTROS" {
"centos10",
"fedora43",
"fedora44",
"fedora45",
"oraclelinux8",
"oraclelinux9",
"oraclelinux10",
Expand Down Expand Up @@ -392,6 +393,18 @@ target "_distro-fedora44" {
}
}

target "_distro-fedora45" {
args = {
DISTRO_NAME = "fedora45"
DISTRO_TYPE = "rpm"
DISTRO_RELEASE = "fedora"
DISTRO_ID = "45"
DISTRO_SUITE = "45"
DISTRO_IMAGE = DISTRO_IMAGE != null && DISTRO_IMAGE != "" ? DISTRO_IMAGE : "fedora:45"
TEST_ONLY = "0"
}
}

target "_distro-oraclelinux8" {
args = {
DISTRO_NAME = "oraclelinux8"
Expand Down Expand Up @@ -525,6 +538,7 @@ function "distroPlatforms" {
centos10 = ["linux/amd64", "linux/arm64", "linux/ppc64le"]
fedora43 = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x"]
fedora44 = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x"]
fedora45 = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x"]
oraclelinux8 = ["linux/amd64", "linux/arm64"]
oraclelinux9 = ["linux/amd64", "linux/arm64"]
oraclelinux10 = ["linux/amd64", "linux/arm64"]
Expand Down
6 changes: 3 additions & 3 deletions pkg/containerd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ RUN --mount=type=bind,source=scripts/pkg-rpm-build.sh,target=/usr/local/bin/pkg-
--mount=type=bind,source=common/containerd.toml,target=/root/rpmbuild/SOURCES/containerd.toml \
--mount=type=bind,from=src-tgz,source=/out/containerd.tgz,target=/root/rpmbuild/SOURCES/containerd.tgz \
--mount=type=bind,from=runc-src-tgz,source=/out/runc.tgz,target=/root/rpmbuild/SOURCES/runc.tgz \
--mount=type=bind,from=src,source=/src,target=/go/src/github.com/containerd/containerd,rw \
--mount=type=bind,from=runc-src,source=/src,target=/go/src/github.com/opencontainers/runc,rw \
--mount=type=bind,from=src,source=/src,target=/usr/local/src/containerd,rw \
--mount=type=bind,from=runc-src,source=/src,target=/usr/local/src/runc,rw \
--mount=type=bind,from=go,source=/usr/local/go,target=/usr/local/go \
OUTDIR=/out SRCDIR=/go/src/github.com/containerd/containerd pkg-rpm-build
OUTDIR=/out SRCDIR=/usr/local/src/containerd RUNC_SRCDIR=/usr/local/src/runc pkg-rpm-build

# static
FROM --platform=$BUILDPLATFORM ${DISTRO_IMAGE} AS builder-static
Expand Down
46 changes: 15 additions & 31 deletions pkg/containerd/rpm/containerd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ AutoReq: no
%global debug_package %{nil}
%endif

%define SHA256SUM0 08f057ece7e518b14cce2e9737228a5a899a7b58b78248a03e02f4a6c079eeaf
%global import_path github.com/containerd/containerd
%global gopath %{getenv:GOPATH}

Name: containerd.io
Provides: containerd
# For some reason on rhel >= 8 if we "provide" runc then it makes this package unsearchable
Expand Down Expand Up @@ -79,50 +75,38 @@ low-level storage and network attachments, etc.


%prep
rm -rf %{_builddir}
if [ ! -d %{_sourcedir}/containerd ]; then
# Copy over our source code from our gopath to our source directory
cp -rf /go/src/%{import_path} %{_sourcedir}/containerd;
fi
# symlink the go source path to our build directory
ln -s /go/src/%{import_path} %{_builddir}

if [ ! -d %{_sourcedir}/runc ]; then
# Copy over our source code from our gopath to our source directory
cp -rf /go/src/github.com/opencontainers/runc %{_sourcedir}/runc
fi
cd %{_builddir}

# Extract containerd (source 0, implicitly extracted) and runc (source 3).
%setup -q -c -n src -a 3

%build
cd %{_builddir}
GO111MODULE=auto make man
GO111MODULE=auto make -C /go/src/%{import_path} VERSION=%{_origversion} REVISION=%{_commit} PACKAGE=%{getenv:PKG_NAME} BUILDTAGS="%{getenv:BUILDTAGS}"
GO111MODULE=auto make -C containerd man
GO111MODULE=auto make -C containerd VERSION=%{_origversion} REVISION=%{_commit} PACKAGE=%{getenv:PKG_NAME} BUILDTAGS="%{getenv:BUILDTAGS}"

# Remove containerd-stress, as we're not shipping it as part of the packages
rm -f bin/containerd-stress
bin/containerd --version
bin/ctr --version
rm -f containerd/bin/containerd-stress
containerd/bin/containerd --version
containerd/bin/ctr --version

# Use runc's pathrs-lite backend until supported distributions package libpathrs.
GO111MODULE=auto make -C /go/src/github.com/opencontainers/runc BINDIR=%{_builddir}/bin RUNC_BUILDTAGS="-libpathrs" runc install
GO111MODULE=auto make -C runc RUNC_BUILDTAGS="-libpathrs" COMMIT="%{_runccommit}" runc


%install
cd %{_builddir}
mkdir -p %{buildroot}%{_bindir}
install -D -p -m 0755 bin/* %{buildroot}%{_bindir}
install -D -p -m 0755 containerd/bin/* %{buildroot}%{_bindir}
install -D -p -m 0644 %{S:1} %{buildroot}%{_unitdir}/containerd.service
install -D -p -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/containerd/config.toml

# install manpages, taking into account that not all sections may be present
for i in $(seq 1 8); do
if ls man/*.${i} 1> /dev/null 2>&1; then
if ls containerd/man/*.${i} 1> /dev/null 2>&1; then
install -d %{buildroot}%{_mandir}/man${i};
install -p -m 644 man/*.${i} %{buildroot}%{_mandir}/man${i};
install -p -m 644 containerd/man/*.${i} %{buildroot}%{_mandir}/man${i};
fi
done

make -C runc BINDIR=%{buildroot}%{_bindir} install

%post
%systemd_post containerd.service

Expand All @@ -136,8 +120,8 @@ done


%files
%license LICENSE
%doc README.md
%license containerd/LICENSE
%doc containerd/README.md
%{_bindir}/*
%{_unitdir}/containerd.service
%{_sysconfdir}/containerd
Expand Down
4 changes: 4 additions & 0 deletions pkg/containerd/scripts/pkg-rpm-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

: "${SOURCE_DATE_EPOCH=}"
: "${SRCDIR=/work/src}"
: "${RUNC_SRCDIR=/work/runc-src}"
: "${OUTDIR=/out}"

: "${TAGPREFIX=}"
Expand All @@ -55,6 +56,8 @@ for l in $(gen-ver "${SRCDIR}"); do
export "${l?}"
done

RUNC_COMMIT="$(git -C "${RUNC_SRCDIR}" describe --dirty --long --always)"

xx-go --wrap
fix-cc

Expand All @@ -63,6 +66,7 @@ rpmDefine=(
--define "_origversion ${GENVER_VERSION}"
--define "_release ${PKG_RPM_RELEASE:-${GENVER_RPM_RELEASE}}"
--define "_commit ${GENVER_COMMIT}"
--define "_runccommit ${RUNC_COMMIT}"
)

pkgoutput="${OUTDIR}/${DISTRO_RELEASE}/${DISTRO_SUITE}/$(xx-info arch)"
Expand Down
Loading