From 6c2e3840a326095a08a7cfb83e7fd35d20afe5a2 Mon Sep 17 00:00:00 2001 From: Sergey Cherevko Date: Wed, 24 Jul 2024 13:55:05 +0300 Subject: [PATCH] Adapted for build under MSVSphere 9 --- .docker-ce.metadata | 1 + .gitignore | 1 + ...0001-MSVSphere-modify-tini.installer.patch | 29 +++++++++++++++ SPECS/docker-ce.spec | 36 ++++++++++++++----- 4 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 SOURCES/0001-MSVSphere-modify-tini.installer.patch diff --git a/.docker-ce.metadata b/.docker-ce.metadata index 9474ad9..40ba385 100644 --- a/.docker-ce.metadata +++ b/.docker-ce.metadata @@ -1 +1,2 @@ d01e03147325efc2a6a9cbf7386783c375d1650b SOURCES/engine.tgz +0e8c96449688d1f9f35197dc02c59fc599f4cb49 SOURCES/tini.tgz diff --git a/.gitignore b/.gitignore index 546efab..d9356e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ SOURCES/engine.tgz +SOURCES/tini.tgz diff --git a/SOURCES/0001-MSVSphere-modify-tini.installer.patch b/SOURCES/0001-MSVSphere-modify-tini.installer.patch new file mode 100644 index 0000000..b25e954 --- /dev/null +++ b/SOURCES/0001-MSVSphere-modify-tini.installer.patch @@ -0,0 +1,29 @@ +From 16bd293b0387766fdb85af9d57ad281c1bc2784b Mon Sep 17 00:00:00 2001 +From: Sergey Cherevko +Date: Wed, 17 Jul 2024 16:12:31 +0300 +Subject: [PATCH] MSVSphere modify tini.installer + +--- + engine/hack/dockerfile/install/tini.installer | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/engine/hack/dockerfile/install/tini.installer b/engine/hack/dockerfile/install/tini.installer +index febceb1..ef9ad8b 100755 +--- a/engine/hack/dockerfile/install/tini.installer ++++ b/engine/hack/dockerfile/install/tini.installer +@@ -7,11 +7,9 @@ + + install_tini() { + echo "Install tini version $TINI_VERSION" +- git clone https://github.com/krallin/tini.git "$GOPATH/tini" + cd "$GOPATH/tini" + git checkout -q "$TINI_VERSION" + cmake . + make tini-static +- mkdir -p "${PREFIX}" +- cp tini-static "${PREFIX}/docker-init" ++ cp tini-static "docker-init" + } +-- +2.43.5 + diff --git a/SPECS/docker-ce.spec b/SPECS/docker-ce.spec index c7b60b0..a1bf273 100644 --- a/SPECS/docker-ce.spec +++ b/SPECS/docker-ce.spec @@ -1,11 +1,18 @@ %global debug_package %{nil} +%global _version 27.0.3 +%global _release 1 +%global _origversion %{_version} + Name: docker-ce Version: %{_version} -Release: %{_release}%{?dist} +Release: %{_release}%{?dist}.inferit Epoch: 3 Source0: engine.tgz +Source1: tini.tgz Patch0: 01-rlimit_nofile-rhel7.patch +# MSVSphere +Patch100: 0001-MSVSphere-modify-tini.installer.patch Summary: The open-source application container engine Group: Tools/Docker License: ASL 2.0 @@ -39,6 +46,7 @@ Requires: xz BuildRequires: bash BuildRequires: ca-certificates BuildRequires: cmake +BuildRequires: golang BuildRequires: gcc BuildRequires: git BuildRequires: glibc-static @@ -54,6 +62,7 @@ BuildRequires: selinux-policy-devel BuildRequires: systemd-devel BuildRequires: tar BuildRequires: which +BuildRequires: kernel-rpm-macros # conflicting packages Conflicts: docker @@ -61,9 +70,9 @@ Conflicts: docker-io Conflicts: docker-ee # Obsolete packages -Obsoletes: docker-ce-selinux -Obsoletes: docker-engine-selinux -Obsoletes: docker-engine +#Obsoletes: docker-ce-selinux +#Obsoletes: docker-engine-selinux +#Obsoletes: docker-engine %description Docker is a product for you to build, ship and run any application as a @@ -81,16 +90,20 @@ depending on a particular stack or provider. %if 0%{?rhel} == 7 %patch -p1 -P 0 %endif +%patch100 -p1 + %build export DOCKER_GITCOMMIT=%{_gitcommit_engine} -mkdir -p /go/src/github.com/docker -ln -snf ${RPM_BUILD_DIR}/src/engine /go/src/github.com/docker/docker +mkdir -p ${RPM_BUILD_DIR}/go/src/github.com/docker +ln -snf ${RPM_BUILD_DIR}/src/engine ${RPM_BUILD_DIR}/go/src/github.com/docker/docker pushd ${RPM_BUILD_DIR}/src/engine -TMP_GOPATH="/go" hack/dockerfile/install/install.sh tini -VERSION=%{_origversion} PRODUCT=docker hack/make.sh dynbinary +export TMP_GOPATH="${RPM_BUILD_DIR}/go" +tar -xf %{SOURCE1} -C "$TMP_GOPATH" +TMP_GOPATH="${RPM_BUILD_DIR}/go" hack/dockerfile/install/install.sh tini +GOPATH="${RPM_BUILD_DIR}/go" VERSION=%{_origversion} PRODUCT=docker hack/make.sh dynbinary popd %check @@ -100,7 +113,8 @@ ver="$(engine/bundles/dynbinary-daemon/dockerd --version)"; \ %install install -D -p -m 0755 $(readlink -f engine/bundles/dynbinary-daemon/dockerd) ${RPM_BUILD_ROOT}%{_bindir}/dockerd install -D -p -m 0755 $(readlink -f engine/bundles/dynbinary-daemon/docker-proxy) ${RPM_BUILD_ROOT}%{_bindir}/docker-proxy -install -D -p -m 0755 /usr/local/bin/docker-init ${RPM_BUILD_ROOT}%{_libexecdir}/docker/docker-init +install -D -p -m 0755 $(readlink -f engine/bundles/dynbinary-daemon/docker-proxy) ${RPM_BUILD_ROOT}%{_bindir}/docker-proxy +install -D -p -m 0755 ${RPM_BUILD_DIR}/go/tini/docker-init ${RPM_BUILD_ROOT}%{_libexecdir}/docker/docker-init # install systemd scripts install -D -m 0644 engine/contrib/init/systemd/docker.service ${RPM_BUILD_ROOT}%{_unitdir}/docker.service @@ -130,3 +144,7 @@ fi %systemd_postun_with_restart docker.service %changelog +* Wed Jul 17 2024 Sergey Cherevko - 27.0.3-1.inferit +- Adapted for build under MSVSphere 9 +- Rebuilt for MSVSphere 9.4 +