From a438006e4f6d2ba7a37d82ffb1782aefd05c4ab1 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 Upstream-commit: 94943b47520aa81bbe30fbc4eb927c79047ef6d2 Component: packaging --- 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 f162d46aa37d40b78bedd6ad871d7fa19bfe0394 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 Upstream-commit: 1c0fdb57a4c7d485f301050e140ad57bdf231cde Component: packaging --- 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 9e79d0f6a4..7f19508b02 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 %description Docker is an open source project to build, ship and run any application as a diff --git a/components/packaging/rpm/fedora-24/docker-ce.spec b/components/packaging/rpm/fedora-24/docker-ce.spec index 692d870004..f79ed1889d 100644 --- a/components/packaging/rpm/fedora-24/docker-ce.spec +++ b/components/packaging/rpm/fedora-24/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 %description Docker is an open source project to build, ship and run any application as a diff --git a/components/packaging/rpm/fedora-25/docker-ce.spec b/components/packaging/rpm/fedora-25/docker-ce.spec index 556885b651..b3aa3a178f 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 %description Docker is an open source project to build, ship and run any application as a From 0badb5dd2c34e589cf70c0de3b4c9249ae82d8ac 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 Upstream-commit: d9b0a3c4106bd9edb38c38f968fab47409c8eeb1 Component: packaging --- 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 4b4c229f4ea397ed12f0161a72e99a25f47471c8 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 Upstream-commit: 24e443c109ae5e133f1b20e6c4f9a17126767c71 Component: packaging --- 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 57d05d56cb..c0f13fb8b1 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 ed55c1d9c6..29eb931c5e 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 69f5c81281..a9673f89e8 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 1a754b3d95c80f54304939e4529488914f76512c 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 Upstream-commit: f7ad018c91316588a756e4e97cd48c246b2c1419 Component: packaging --- 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 a189d6d7559bf5a4ab8edf3db7fe5dc7c63e9d2b 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 Upstream-commit: 3152177fdd93d6e3d8c930600bd9bff4f9a36e1d Component: packaging --- .../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 818b36b773..72c32837f8 100644 --- a/components/packaging/rpm/centos-7/docker-ce.spec +++ b/components/packaging/rpm/centos-7/docker-ce.spec @@ -154,6 +154,20 @@ install -p -m 644 engine/contrib/syntax/nano/Dockerfile.nanorc $RPM_BUILD_ROOT/u /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 @@ -166,6 +180,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 * Thu Jun 15 2017 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 d12c39b9a9..96d11db893 100644 --- a/components/packaging/rpm/fedora-24/docker-ce.spec +++ b/components/packaging/rpm/fedora-24/docker-ce.spec @@ -155,6 +155,20 @@ install -p -m 644 engine/contrib/syntax/nano/Dockerfile.nanorc $RPM_BUILD_ROOT/u /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 @@ -167,6 +181,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 * Thu Jun 15 2017 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 56c8f6448e..42e96bc168 100644 --- a/components/packaging/rpm/fedora-25/docker-ce.spec +++ b/components/packaging/rpm/fedora-25/docker-ce.spec @@ -153,6 +153,20 @@ install -p -m 644 engine/contrib/syntax/nano/Dockerfile.nanorc $RPM_BUILD_ROOT/u /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 @@ -165,6 +179,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 * Thu Jun 15 2017 17.06.0-ce-rc4