Skip to content

Commit

Permalink
Revert "Packaging distributions backport release/0.3 (#423)"
Browse files Browse the repository at this point in the history
This reverts commit e0b1257.
  • Loading branch information
nwneisen authored Jan 21, 2025
1 parent 5959ccb commit 5877cc5
Show file tree
Hide file tree
Showing 14 changed files with 195 additions and 42 deletions.
17 changes: 8 additions & 9 deletions packaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ This repo contains the open source scripts for packaging cri-docker

The scripts will build for this list of packages types:

* DEB packages for Ubuntu 24.04 Noble
* DEB packages for Ubuntu 22.04 Jammy
* DEB packages for Ubuntu 20.04 Focal
* DEB packages for Ubuntu 19.04 Disco
* DEB packages for Ubuntu 18.10 Cosmic
* DEB packages for Ubuntu 18.04 Bionic
* DEB packages for Ubuntu 16.04 Xenial
* DEB packages for Debian 12 Bookworm
* DEB packages for Debian 11 Bullseye
* RPM packages for Fedora 41
* RPM packages for Fedora 40
* RPM packages for AlmaLinux 9
* RPM packages for AlmaLinux 8
* DEB packages for Debian 10 Buster
* DEB packages for Debian 9 Stretch
* RPM packages for Fedora 31
* RPM packages for Fedora 30
* RPM packages for Fedora 29
* RPM packages for CentOS 7
* TGZ and ZIP files with static binaries
4 changes: 2 additions & 2 deletions packaging/deb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ SOURCE_FILES=app.tgz cri-docker.service cri-docker.socket
SOURCES=$(addprefix sources/, $(SOURCE_FILES))

DEBIAN_VERSIONS := debian-bullseye debian-bookworm
#UBUNTU_VERSIONS := ubuntu-xenial ubuntu-bionic
UBUNTU_VERSIONS := ubuntu-focal ubuntu-jammy ubuntu-noble
#UBUNTU_VERSIONS := ubuntu-xenial ubuntu-bionic ubuntu-cosmic ubuntu-disco ubuntu-eoan
UBUNTU_VERSIONS := ubuntu-bionic ubuntu-focal ubuntu-jammy
RASPBIAN_VERSIONS := raspbian-bullseye
DISTROS := $(DEBIAN_VERSIONS) $(UBUNTU_VERSIONS) $(RASPBIAN_VERSIONS)

Expand Down
39 changes: 39 additions & 0 deletions packaging/deb/ubuntu-cosmic/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
ARG GO_IMAGE
ARG DISTRO=ubuntu
ARG SUITE=cosmic
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}

# Remove diverted man binary to prevent man-pages being replaced with "minimized" message. See docker/for-linux#639
RUN if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then \
rm -f /usr/bin/man; \
dpkg-divert --quiet --remove --rename /usr/bin/man; \
fi

RUN apt-get update && apt-get install -y curl devscripts equivs git

ENV GOPROXY=direct
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
ENV DOCKER_BUILDTAGS apparmor seccomp selinux
ENV RUNC_BUILDTAGS apparmor seccomp selinux

ARG COMMON_FILES
COPY ${COMMON_FILES} /root/build-deb/debian
RUN mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/build-deb/debian/control

COPY sources/ /sources
ARG DISTRO
ARG SUITE
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}

COPY --from=golang /usr/local/go /usr/local/go

WORKDIR /root/build-deb
COPY build-deb /root/build-deb/build-deb

ENTRYPOINT ["/root/build-deb/build-deb"]
39 changes: 39 additions & 0 deletions packaging/deb/ubuntu-disco/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
ARG GO_IMAGE
ARG DISTRO=ubuntu
ARG SUITE=disco
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}

# Remove diverted man binary to prevent man-pages being replaced with "minimized" message. See docker/for-linux#639
RUN if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then \
rm -f /usr/bin/man; \
dpkg-divert --quiet --remove --rename /usr/bin/man; \
fi

RUN apt-get update && apt-get install -y curl devscripts equivs git

ENV GOPROXY=direct
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
ENV DOCKER_BUILDTAGS apparmor seccomp selinux
ENV RUNC_BUILDTAGS apparmor seccomp selinux

ARG COMMON_FILES
COPY ${COMMON_FILES} /root/build-deb/debian
RUN mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/build-deb/debian/control

COPY sources/ /sources
ARG DISTRO
ARG SUITE
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}

COPY --from=golang /usr/local/go /usr/local/go

WORKDIR /root/build-deb
COPY build-deb /root/build-deb/build-deb

ENTRYPOINT ["/root/build-deb/build-deb"]
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
ARG GO_IMAGE
ARG DISTRO=ubuntu
ARG SUITE=noble
ARG SUITE=eoan
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}

ARG DEBIAN_FRONTEND=noninteractive
# Remove diverted man binary to prevent man-pages being replaced with "minimized" message. See docker/for-linux#639
RUN if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then \
rm -f /usr/bin/man; \
dpkg-divert --quiet --remove --rename /usr/bin/man; \
fi

RUN apt-get update && apt-get install -y curl devscripts equivs git

ENV GOPROXY=direct
Expand Down
14 changes: 5 additions & 9 deletions packaging/rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ RUN?=$(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS)
SOURCE_FILES=app.tgz cri-docker.service cri-docker.socket LICENSE
SOURCES=$(addprefix rpmbuild/SOURCES/, $(SOURCE_FILES))

FEDORA_RELEASES := fedora-39 fedora-40
FEDORA_RELEASES := fedora-36 fedora-35
CENTOS_RELEASES :=
ALMALINUX_RELEASES := almalinux-8 almalinux-9

.PHONY: help
help: ## show make targets
Expand All @@ -56,19 +55,16 @@ clean: ## remove build artifacts
$(RM) -r rpmbuild/

.PHONY: rpm
rpm: fedora centos almalinux ## build all rpm packages
rpm: fedora centos ## build all rpm packages

.PHONY: fedora
fedora: $(FEDORA_RELEASES) ## build all fedora rpm packages

.PHONY: centos
centos: $(CENTOS_RELEASES) ## build all centos stream rpm packages
centos: $(CENTOS_RELEASES) ## build all centos rpm packages

.PHONY: almalinux
almalinux: $(ALMALINUX_RELEASES) ## build all almalinux rpm packages

.PHONY: $(FEDORA_RELEASES) $(CENTOS_RELEASES) $(ALMALINUX_RELEASES)
$(FEDORA_RELEASES) $(CENTOS_RELEASES) $(ALMALINUX_RELEASES): $(SOURCES)
.PHONY: $(FEDORA_RELEASES) $(CENTOS_RELEASES)
$(FEDORA_RELEASES) $(CENTOS_RELEASES): $(SOURCES)
@echo "${APP_DIR}"
@echo "${VERSION}"
@echo "$(shell ./gen-rpm-ver $(APP_DIR) $(VERSION))"
Expand Down
3 changes: 0 additions & 3 deletions packaging/rpm/SPECS/cri-dockerd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ Requires: (iptables or nftables)
Requires: iptables
%endif
%if %{undefined suse_version}
%if %{undefined rhel} || 0%{?rhel} < 9
# Libcgroup is no longer available in RHEL/CentOS >= 9 distros.
Requires: libcgroup
%endif
%endif
Requires: containerd.io >= 1.2.2-3
Requires: tar
Requires: xz
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
ARG GO_IMAGE
ARG DISTRO=almalinux
ARG SUITE=8
ARG DISTRO=centos
ARG SUITE=7
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ARG DISTRO
ARG SUITE
ENV DISTRO ${DISTRO}
ENV SUITE ${SUITE}
ENV GOPROXY=direct
ENV GOPATH=/go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS seccomp selinux
ENV RUNC_BUILDTAGS seccomp selinux
ARG DISTRO
ARG SUITE
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
RUN yum install -y rpm-build rpmlint
COPY SPECS /root/rpmbuild/SPECS
# Overwrite repo that was failing on aarch64
RUN sed -i 's/altarch/centos/g' /etc/yum.repos.d/CentOS-Sources.repo
RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec
COPY --from=golang /usr/local/go /usr/local/go/
COPY --from=golang /usr/local/go /usr/local/go
WORKDIR /root/rpmbuild
ENTRYPOINT ["/bin/rpmbuild"]
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
ARG GO_IMAGE
ARG DISTRO=almalinux
ARG SUITE=9
ARG DISTRO=centos
ARG SUITE=8
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ARG DISTRO
ARG SUITE
ENV DISTRO ${DISTRO}
ENV SUITE ${SUITE}
ENV GOPROXY=direct
ENV GOPATH=/go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS seccomp selinux
ENV RUNC_BUILDTAGS seccomp selinux
RUN yum install -y rpm-build rpmlint
ARG DISTRO
ARG SUITE
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
RUN yum install -y rpm-build rpmlint yum-utils
RUN dnf config-manager --set-enabled powertools
COPY SPECS /root/rpmbuild/SPECS
# Overwrite repo that was failing on aarch64
RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec
COPY --from=golang /usr/local/go /usr/local/go/
COPY --from=golang /usr/local/go /usr/local/go
WORKDIR /root/rpmbuild
ENTRYPOINT ["/bin/rpmbuild"]
26 changes: 26 additions & 0 deletions packaging/rpm/centos-stream/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ARG GO_IMAGE
ARG DISTRO=aepifanov/centos7.vault
ARG SUITE=latest
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ENV GOPROXY=direct
ENV GOPATH=/go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS seccomp selinux
ENV RUNC_BUILDTAGS seccomp selinux
ARG DISTRO
ARG SUITE
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
RUN yum install -y rpm-build rpmlint yum-utils
RUN dnf config-manager --set-enabled powertools
COPY SPECS /root/rpmbuild/SPECS
# Overwrite repo that was failing on aarch64
RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec
COPY --from=golang /usr/local/go /usr/local/go
WORKDIR /root/rpmbuild
ENTRYPOINT ["/bin/rpmbuild"]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG GO_IMAGE
ARG DISTRO=fedora
ARG SUITE=41
ARG SUITE=33
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG GO_IMAGE
ARG DISTRO=fedora
ARG SUITE=40
ARG SUITE=34
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang
Expand Down
24 changes: 24 additions & 0 deletions packaging/rpm/fedora-35/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ARG GO_IMAGE
ARG DISTRO=fedora
ARG SUITE=35
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ENV GOPROXY=direct
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS seccomp selinux
ENV RUNC_BUILDTAGS seccomp selinux
ARG DISTRO
ARG SUITE
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
RUN dnf install -y rpm-build rpmlint dnf-plugins-core
COPY SPECS /root/rpmbuild/SPECS
RUN dnf builddep -y /root/rpmbuild/SPECS/*.spec
COPY --from=golang /usr/local/go /usr/local/go
WORKDIR /root/rpmbuild
ENTRYPOINT ["/bin/rpmbuild"]
24 changes: 24 additions & 0 deletions packaging/rpm/fedora-36/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ARG GO_IMAGE
ARG DISTRO=fedora
ARG SUITE=36
ARG BUILD_IMAGE=${DISTRO}:${SUITE}

FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ENV GOPROXY=direct
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS seccomp selinux
ENV RUNC_BUILDTAGS seccomp selinux
ARG DISTRO
ARG SUITE
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
RUN dnf install -y rpm-build rpmlint dnf-plugins-core
COPY SPECS /root/rpmbuild/SPECS
RUN dnf builddep -y /root/rpmbuild/SPECS/*.spec
COPY --from=golang /usr/local/go /usr/local/go
WORKDIR /root/rpmbuild
ENTRYPOINT ["/bin/rpmbuild"]

0 comments on commit 5877cc5

Please sign in to comment.