From 29e8b830bb098c602c12ae912e2850e8f5125210 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Fri, 16 Jun 2017 14:43:17 -0400 Subject: [PATCH 1/6] Mark docker-*-selinux pkgs as obsolete These are replaced by `container-selinux` on fedora-25 and centos-7. Marking these packages as obsolete makes the installation process a bit smoother, otherwise the user will have to manually uninstall the older packages to install the new one. Also makes fedora24 use container-selinux which is now supports labeling the `dockerd` binary correctly. Signed-off-by: Brian Goff (cherry picked from commit 94943b47520aa81bbe30fbc4eb927c79047ef6d2) Signed-off-by: Andrew Hsu --- components/packaging/rpm/centos-7/docker-ce.spec | 5 +++++ components/packaging/rpm/fedora-24/docker-ce.spec | 6 ++++++ components/packaging/rpm/fedora-25/docker-ce.spec | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/components/packaging/rpm/centos-7/docker-ce.spec b/components/packaging/rpm/centos-7/docker-ce.spec index 9e79d0f6a4..818b36b773 100644 --- a/components/packaging/rpm/centos-7/docker-ce.spec +++ b/components/packaging/rpm/centos-7/docker-ce.spec @@ -36,6 +36,11 @@ Conflicts: docker Conflicts: docker-io Conflicts: docker-engine-cs +# Obsolete packages +Obsoletes: docker-ce-selinux +Obsoletes: docker-engine-selinux +Obsoletes: docker-engine + %description Docker is an open source project to build, ship and run any application as a lightweight container. diff --git a/components/packaging/rpm/fedora-24/docker-ce.spec b/components/packaging/rpm/fedora-24/docker-ce.spec index 692d870004..d12c39b9a9 100644 --- a/components/packaging/rpm/fedora-24/docker-ce.spec +++ b/components/packaging/rpm/fedora-24/docker-ce.spec @@ -27,6 +27,7 @@ Requires: libcgroup Requires: systemd-units Requires: tar Requires: xz +Requires: container-selinux >= 1.10.3-55 # Resolves: rhbz#1165615 Requires: device-mapper-libs >= 1.02.90-1 @@ -36,6 +37,11 @@ Conflicts: docker Conflicts: docker-io Conflicts: docker-engine-cs +# Obsolete packages +Obsoletes: docker-ce-selinux +Obsoletes: docker-engine-selinux +Obsoletes: docker-engine + %description Docker is an open source project to build, ship and run any application as a lightweight container. diff --git a/components/packaging/rpm/fedora-25/docker-ce.spec b/components/packaging/rpm/fedora-25/docker-ce.spec index 556885b651..56c8f6448e 100644 --- a/components/packaging/rpm/fedora-25/docker-ce.spec +++ b/components/packaging/rpm/fedora-25/docker-ce.spec @@ -35,6 +35,11 @@ Conflicts: docker Conflicts: docker-io Conflicts: docker-engine-cs +# Obsolete packages +Obsoletes: docker-ce-selinux +Obsoletes: docker-engine-selinux +Obsoletes: docker-engine + %description Docker is an open source project to build, ship and run any application as a lightweight container. From 55d38f9cd6e8036761ed152352f45b596a3c4a3e Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Sun, 18 Jun 2017 15:24:56 -0700 Subject: [PATCH 2/6] Add conflicts with docker-ee Signed-off-by: Brian Goff (cherry picked from commit 1c0fdb57a4c7d485f301050e140ad57bdf231cde) Signed-off-by: Andrew Hsu --- components/packaging/deb/common/control | 2 +- components/packaging/rpm/centos-7/docker-ce.spec | 1 + components/packaging/rpm/fedora-24/docker-ce.spec | 1 + components/packaging/rpm/fedora-25/docker-ce.spec | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/packaging/deb/common/control b/components/packaging/deb/common/control index 45ca68f1c3..ce6a86f43b 100644 --- a/components/packaging/deb/common/control +++ b/components/packaging/deb/common/control @@ -16,7 +16,7 @@ Recommends: aufs-tools, git, xz-utils, ${apparmor:Recommends} -Conflicts: docker (<< 1.5~), docker.io, lxc-docker, lxc-docker-virtual-package, docker-engine-cs +Conflicts: docker (<< 1.5~), docker.io, lxc-docker, lxc-docker-virtual-package, docker-engine-cs, docker-ee Replaces: docker-engine Description: Docker: the open-source application container engine Docker is an open source project to build, ship and run any application as a diff --git a/components/packaging/rpm/centos-7/docker-ce.spec b/components/packaging/rpm/centos-7/docker-ce.spec index 818b36b773..57d05d56cb 100644 --- a/components/packaging/rpm/centos-7/docker-ce.spec +++ b/components/packaging/rpm/centos-7/docker-ce.spec @@ -35,6 +35,7 @@ Requires: device-mapper-libs >= 1.02.90-1 Conflicts: docker Conflicts: docker-io Conflicts: docker-engine-cs +Conflicts: docker-ee # Obsolete packages Obsoletes: docker-ce-selinux diff --git a/components/packaging/rpm/fedora-24/docker-ce.spec b/components/packaging/rpm/fedora-24/docker-ce.spec index d12c39b9a9..ed55c1d9c6 100644 --- a/components/packaging/rpm/fedora-24/docker-ce.spec +++ b/components/packaging/rpm/fedora-24/docker-ce.spec @@ -36,6 +36,7 @@ Requires: device-mapper-libs >= 1.02.90-1 Conflicts: docker Conflicts: docker-io Conflicts: docker-engine-cs +Conflicts: docker-ee # Obsolete packages Obsoletes: docker-ce-selinux diff --git a/components/packaging/rpm/fedora-25/docker-ce.spec b/components/packaging/rpm/fedora-25/docker-ce.spec index 56c8f6448e..69f5c81281 100644 --- a/components/packaging/rpm/fedora-25/docker-ce.spec +++ b/components/packaging/rpm/fedora-25/docker-ce.spec @@ -34,6 +34,7 @@ Requires: device-mapper-libs >= 1.02.90-1 Conflicts: docker Conflicts: docker-io Conflicts: docker-engine-cs +Conflicts: docker-ee # Obsolete packages Obsoletes: docker-ce-selinux From eb990142acca0e1bc73035db858dd66c403d7707 Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Mon, 19 Jun 2017 18:23:13 -0700 Subject: [PATCH 3/6] bump Version to 17.06.-ce-rc5 Signed-off-by: Eli Uriegas (cherry picked from commit d9b0a3c4106bd9edb38c38f968fab47409c8eeb1) Signed-off-by: Andrew Hsu --- components/packaging/rpm/centos-7/docker-ce.spec | 3 +++ components/packaging/rpm/fedora-24/docker-ce.spec | 3 +++ components/packaging/rpm/fedora-25/docker-ce.spec | 3 +++ 3 files changed, 9 insertions(+) diff --git a/components/packaging/rpm/centos-7/docker-ce.spec b/components/packaging/rpm/centos-7/docker-ce.spec index 57d05d56cb..3b3d4b8e53 100644 --- a/components/packaging/rpm/centos-7/docker-ce.spec +++ b/components/packaging/rpm/centos-7/docker-ce.spec @@ -169,6 +169,9 @@ fi %changelog +* Mon Jun 19 2017 17.06.0-ce-rc5 +- release docker-ce 17.06.0-ce-rc5 + * Thu Jun 15 2017 17.06.0-ce-rc4 - release docker-ce 17.06.0-ce-rc4 diff --git a/components/packaging/rpm/fedora-24/docker-ce.spec b/components/packaging/rpm/fedora-24/docker-ce.spec index ed55c1d9c6..66bb374de1 100644 --- a/components/packaging/rpm/fedora-24/docker-ce.spec +++ b/components/packaging/rpm/fedora-24/docker-ce.spec @@ -170,6 +170,9 @@ fi %changelog +* Mon Jun 19 2017 17.06.0-ce-rc5 +- release docker-ce 17.06.0-ce-rc5 + * Thu Jun 15 2017 17.06.0-ce-rc4 - release docker-ce 17.06.0-ce-rc4 diff --git a/components/packaging/rpm/fedora-25/docker-ce.spec b/components/packaging/rpm/fedora-25/docker-ce.spec index 69f5c81281..e097dd40c1 100644 --- a/components/packaging/rpm/fedora-25/docker-ce.spec +++ b/components/packaging/rpm/fedora-25/docker-ce.spec @@ -168,6 +168,9 @@ fi %changelog +* Mon Jun 19 2017 17.06.0-ce-rc5 +- release docker-ce 17.06.0-ce-rc5 + * Thu Jun 15 2017 17.06.0-ce-rc4 - release docker-ce 17.06.0-ce-rc4 From 672ea2ab2a36bb396f7305e74e00f161c2f38230 Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Mon, 19 Jun 2017 18:29:22 -0700 Subject: [PATCH 4/6] Prefixes documentation files per component (#21) * Prefixes documentation files per component Signed-off-by: Eli Uriegas * Remove reliance on basename Signed-off-by: Eli Uriegas (cherry picked from commit 24e443c109ae5e133f1b20e6c4f9a17126767c71) Signed-off-by: Andrew Hsu --- components/packaging/rpm/centos-7/docker-ce.spec | 11 ++++++++++- components/packaging/rpm/fedora-24/docker-ce.spec | 11 ++++++++++- components/packaging/rpm/fedora-25/docker-ce.spec | 11 ++++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/components/packaging/rpm/centos-7/docker-ce.spec b/components/packaging/rpm/centos-7/docker-ce.spec index 3b3d4b8e53..e0f4087de9 100644 --- a/components/packaging/rpm/centos-7/docker-ce.spec +++ b/components/packaging/rpm/centos-7/docker-ce.spec @@ -130,9 +130,18 @@ install -p -m 644 engine/contrib/syntax/vim/syntax/dockerfile.vim $RPM_BUILD_ROO install -d $RPM_BUILD_ROOT/usr/share/nano install -p -m 644 engine/contrib/syntax/nano/Dockerfile.nanorc $RPM_BUILD_ROOT/usr/share/nano/Dockerfile.nanorc +mkdir -p build-docs +for engine_file in AUTHORS CHANGELOG.md CONTRIBUTING.md LICENSE MAINTAINERS NOTICE README.md; do + cp "engine/$engine_file" "build-docs/engine-$engine_file" +done +for cli_file in LICENSE MAINTAINERS NOTICE README.md; do + cp "cli/$cli_file" "build-docs/cli-$cli_file" +done + # list files owned by the package here %files -%doc engine/AUTHORS engine/CHANGELOG.md engine/CONTRIBUTING.md engine/LICENSE engine/MAINTAINERS engine/NOTICE engine/README.md +%doc build-docs/engine-AUTHORS build-docs/engine-CHANGELOG.md build-docs/engine-CONTRIBUTING.md build-docs/engine-LICENSE build-docs/engine-MAINTAINERS build-docs/engine-NOTICE build-docs/engine-README.md +%doc build-docs/cli-LICENSE build-docs/cli-MAINTAINERS build-docs/cli-NOTICE build-docs/cli-README.md /%{_bindir}/docker /%{_bindir}/dockerd /%{_bindir}/docker-containerd diff --git a/components/packaging/rpm/fedora-24/docker-ce.spec b/components/packaging/rpm/fedora-24/docker-ce.spec index 66bb374de1..543dd90534 100644 --- a/components/packaging/rpm/fedora-24/docker-ce.spec +++ b/components/packaging/rpm/fedora-24/docker-ce.spec @@ -131,9 +131,18 @@ install -p -m 644 engine/contrib/syntax/vim/syntax/dockerfile.vim $RPM_BUILD_ROO install -d $RPM_BUILD_ROOT/usr/share/nano install -p -m 644 engine/contrib/syntax/nano/Dockerfile.nanorc $RPM_BUILD_ROOT/usr/share/nano/Dockerfile.nanorc +mkdir -p build-docs +for engine_file in AUTHORS CHANGELOG.md CONTRIBUTING.md LICENSE MAINTAINERS NOTICE README.md; do + cp "engine/$engine_file" "build-docs/engine-$engine_file" +done +for cli_file in LICENSE MAINTAINERS NOTICE README.md; do + cp "cli/$cli_file" "build-docs/cli-$cli_file" +done + # list files owned by the package here %files -%doc engine/AUTHORS engine/CHANGELOG.md engine/CONTRIBUTING.md engine/LICENSE engine/MAINTAINERS engine/NOTICE engine/README.md +%doc build-docs/engine-AUTHORS build-docs/engine-CHANGELOG.md build-docs/engine-CONTRIBUTING.md build-docs/engine-LICENSE build-docs/engine-MAINTAINERS build-docs/engine-NOTICE build-docs/engine-README.md +%doc build-docs/cli-LICENSE build-docs/cli-MAINTAINERS build-docs/cli-NOTICE build-docs/cli-README.md /%{_bindir}/docker /%{_bindir}/dockerd /%{_bindir}/docker-containerd diff --git a/components/packaging/rpm/fedora-25/docker-ce.spec b/components/packaging/rpm/fedora-25/docker-ce.spec index e097dd40c1..73a06e5895 100644 --- a/components/packaging/rpm/fedora-25/docker-ce.spec +++ b/components/packaging/rpm/fedora-25/docker-ce.spec @@ -129,9 +129,18 @@ install -p -m 644 engine/contrib/syntax/vim/syntax/dockerfile.vim $RPM_BUILD_ROO install -d $RPM_BUILD_ROOT/usr/share/nano install -p -m 644 engine/contrib/syntax/nano/Dockerfile.nanorc $RPM_BUILD_ROOT/usr/share/nano/Dockerfile.nanorc +mkdir -p build-docs +for engine_file in AUTHORS CHANGELOG.md CONTRIBUTING.md LICENSE MAINTAINERS NOTICE README.md; do + cp "engine/$engine_file" "build-docs/engine-$engine_file" +done +for cli_file in LICENSE MAINTAINERS NOTICE README.md; do + cp "cli/$cli_file" "build-docs/cli-$cli_file" +done + # list files owned by the package here %files -%doc engine/AUTHORS engine/CHANGELOG.md engine/CONTRIBUTING.md engine/LICENSE engine/MAINTAINERS engine/NOTICE engine/README.md +%doc build-docs/engine-AUTHORS build-docs/engine-CHANGELOG.md build-docs/engine-CONTRIBUTING.md build-docs/engine-LICENSE build-docs/engine-MAINTAINERS build-docs/engine-NOTICE build-docs/engine-README.md +%doc build-docs/cli-LICENSE build-docs/cli-MAINTAINERS build-docs/cli-NOTICE build-docs/cli-README.md /%{_bindir}/docker /%{_bindir}/dockerd /%{_bindir}/docker-containerd From 5303070e05f8627848bd1bc3bc948c413897b162 Mon Sep 17 00:00:00 2001 From: Andrew Hsu Date: Tue, 20 Jun 2017 03:55:08 +0000 Subject: [PATCH 5/6] also have deb pkg conflict docker-engine Signed-off-by: Andrew Hsu (cherry picked from commit f7ad018c91316588a756e4e97cd48c246b2c1419) Signed-off-by: Andrew Hsu --- components/packaging/deb/common/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/packaging/deb/common/control b/components/packaging/deb/common/control index ce6a86f43b..a3285cd0cf 100644 --- a/components/packaging/deb/common/control +++ b/components/packaging/deb/common/control @@ -16,7 +16,7 @@ Recommends: aufs-tools, git, xz-utils, ${apparmor:Recommends} -Conflicts: docker (<< 1.5~), docker.io, lxc-docker, lxc-docker-virtual-package, docker-engine-cs, docker-ee +Conflicts: docker (<< 1.5~), docker.io, lxc-docker, lxc-docker-virtual-package, docker-engine, docker-engine-cs, docker-ee Replaces: docker-engine Description: Docker: the open-source application container engine Docker is an open source project to build, ship and run any application as a From 19db96873d6bb6eac9e4da78df0475eea4d3107a Mon Sep 17 00:00:00 2001 From: Andrew Hsu Date: Mon, 19 Jun 2017 18:29:15 +0000 Subject: [PATCH 6/6] restart docker service if needed for rpm upgrade Signed-off-by: Andrew Hsu (cherry picked from commit 3152177fdd93d6e3d8c930600bd9bff4f9a36e1d) Signed-off-by: Andrew Hsu --- .../packaging/rpm/centos-7/docker-ce.spec | 25 +++++++++++++++++++ .../packaging/rpm/fedora-24/docker-ce.spec | 25 +++++++++++++++++++ .../packaging/rpm/fedora-25/docker-ce.spec | 25 +++++++++++++++++++ 3 files changed, 75 insertions(+) diff --git a/components/packaging/rpm/centos-7/docker-ce.spec b/components/packaging/rpm/centos-7/docker-ce.spec index e0f4087de9..c04be0a07c 100644 --- a/components/packaging/rpm/centos-7/docker-ce.spec +++ b/components/packaging/rpm/centos-7/docker-ce.spec @@ -164,6 +164,20 @@ done /usr/share/vim/vimfiles/syntax/dockerfile.vim /usr/share/nano/Dockerfile.nanorc +%pre +if [ $1 -gt 0 ] ; then + # package upgrade scenario, before new files are installed + + # clear any old state + rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : + + # check if docker service is running + if systemctl is-active docker > /dev/null 2>&1; then + systemctl stop docker > /dev/null 2>&1 || : + touch %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : + fi +fi + %post %systemd_post docker if ! getent group docker > /dev/null; then @@ -176,6 +190,17 @@ fi %postun %systemd_postun_with_restart docker +%posttrans +if [ $1 -ge 0 ] ; then + # package upgrade scenario, after new files are installed + + # check if docker was running before upgrade + if [ -f %{_localstatedir}/lib/rpm-state/docker-is-active ]; then + systemctl start docker > /dev/null 2>&1 || : + rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : + fi +fi + %changelog * Mon Jun 19 2017 17.06.0-ce-rc5 diff --git a/components/packaging/rpm/fedora-24/docker-ce.spec b/components/packaging/rpm/fedora-24/docker-ce.spec index 543dd90534..4f6694c37b 100644 --- a/components/packaging/rpm/fedora-24/docker-ce.spec +++ b/components/packaging/rpm/fedora-24/docker-ce.spec @@ -165,6 +165,20 @@ done /usr/share/vim/vimfiles/syntax/dockerfile.vim /usr/share/nano/Dockerfile.nanorc +%pre +if [ $1 -gt 0 ] ; then + # package upgrade scenario, before new files are installed + + # clear any old state + rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : + + # check if docker service is running + if systemctl is-active docker > /dev/null 2>&1; then + systemctl stop docker > /dev/null 2>&1 || : + touch %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : + fi +fi + %post %systemd_post docker if ! getent group docker > /dev/null; then @@ -177,6 +191,17 @@ fi %postun %systemd_postun_with_restart docker +%posttrans +if [ $1 -ge 0 ] ; then + # package upgrade scenario, after new files are installed + + # check if docker was running before upgrade + if [ -f %{_localstatedir}/lib/rpm-state/docker-is-active ]; then + systemctl start docker > /dev/null 2>&1 || : + rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : + fi +fi + %changelog * Mon Jun 19 2017 17.06.0-ce-rc5 diff --git a/components/packaging/rpm/fedora-25/docker-ce.spec b/components/packaging/rpm/fedora-25/docker-ce.spec index 73a06e5895..f85e9214b9 100644 --- a/components/packaging/rpm/fedora-25/docker-ce.spec +++ b/components/packaging/rpm/fedora-25/docker-ce.spec @@ -163,6 +163,20 @@ done /usr/share/vim/vimfiles/syntax/dockerfile.vim /usr/share/nano/Dockerfile.nanorc +%pre +if [ $1 -gt 0 ] ; then + # package upgrade scenario, before new files are installed + + # clear any old state + rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : + + # check if docker service is running + if systemctl is-active docker > /dev/null 2>&1; then + systemctl stop docker > /dev/null 2>&1 || : + touch %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : + fi +fi + %post %systemd_post docker if ! getent group docker > /dev/null; then @@ -175,6 +189,17 @@ fi %postun %systemd_postun_with_restart docker +%posttrans +if [ $1 -ge 0 ] ; then + # package upgrade scenario, after new files are installed + + # check if docker was running before upgrade + if [ -f %{_localstatedir}/lib/rpm-state/docker-is-active ]; then + systemctl start docker > /dev/null 2>&1 || : + rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : + fi +fi + %changelog * Mon Jun 19 2017 17.06.0-ce-rc5