加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
moby.spec 9.53 KB
一键复制 编辑 原始数据 按行查看 历史
Jackey_1024 提交于 2024-11-11 20:22 . upgrade to 27.3.1
# open this flag when support more package about go in the futrue
%bcond_with fish
%global tini_version 0.19.0
%global __bindir %_builddir/%{name}-%{version}
%global goipath github.com/docker
Summary: The open-source application container engine
Name: moby
Version: 27.3.1
Release: 1%{?dist}
License: ASL 2.0
URL: https://mobyproject.org
Source0: https://github.com/%{name}/%{name}/archive/refs/tags/v%{version}.tar.gz
# note: ignore "#/cli-25.0.3.tar.gz"
Source1: https://github.com/docker/cli/archive/refs/tags/v%{version}.tar.gz#/cli-%{version}.tar.gz
Source2: https://github.com/krallin/tini/archive/refs/tags/v%{tini_version}.tar.gz
Source3: docker.service
Source4: docker.sysconfig
Source5: moby-engine-systemd-sysusers.conf
Source6: generate-docs.sh
BuildRequires: pkgconfig(systemd) golang >= 1.19-1 btrfs-progs-devel device-mapper-devel glibc-static
BuildRequires: libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel sqlite-devel
BuildRequires: systemd-devel libseccomp-devel tar git cmake firewalld-filesystem go-md2man go-rpm-macros
Requires: container-selinux containerd runc systemd pigz iptables tar xz
Requires: systemd-units shadow-utils device-mapper-libs
Provides: docker = %{version}-%{release}
Provides: docker-ce = %{version}-%{release}
Conflicts: podman-docker
%description
Docker is an open source project to build, ship and run any application as a
lightweight container.
Docker containers are both hardware-agnostic and platform-agnostic. This means
they can run anywhere, from your laptop to the largest EC2 compute instance and
everything in between - and they don't require you to use a particular
language, framework or packaging system. That makes them great building blocks
for deploying and scaling web apps, databases, and backend services without
depending on a particular stack or provider.
%if %{with fish}
%package fish-completion
Summary: Fish completion files for %{name}
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: fish
Provides: docker-fish-completion = %{version}-%{release}
%description fish-completion
This package installs the open-source application container engine.
%endif
%package zsh-completion
Summary: Zsh completion files for %{name}
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: zsh
Provides: docker-zsh-completion = %{version}-%{release}
%description zsh-completion
This package installs the open-source application container engine.
%package nano
Summary: GNU nano syntax highlighting files for Moby
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: nano
%description nano
This package installs the open-source application container engine.
%prep
%setup -q -a 1 -a 2 -n %{name}-%{version}
# correct rpmlint errors for bash completion
sed -i '/env bash/d' cli-%{version}/contrib/completion/bash/docker
cp %{SOURCE6} cli-%{version}/scripts/docs/generate-man.sh
mv cli-%{version}/LICENSE cli-LICENSE
mv cli-%{version}/MAINTAINERS cli-MAINTAINERS
mv cli-%{version}/NOTICE cli-NOTICE
mv cli-%{version}/README.md cli-README.md
mv cli-%{version}/CONTRIBUTING.md cli-CONTRIBUTING.md
mv cli-%{version}/AUTHORS cli-AUTHORS
%build
mkdir -p %{__bindir}
# build docker-proxy
(
export GOPATH="$PWD/.gopath"
mkdir -p $GOPATH/src/%{goipath}
ln -sfn $PWD $GOPATH/src/%{goipath}/docker
%gobuild -o %{__bindir}/docker-proxy %{goipath}/docker/cmd/docker-proxy
)
# build docker-init
pushd tini-%{tini_version}
%cmake
make tini-static -C "%{__cmake_builddir}"
popd
# build docker engine
(
export GOPATH="$PWD/.gopath"
mkdir -p $GOPATH/src/%{goipath}
ln -sfn $PWD $GOPATH/src/%{goipath}/docker
export LDFLAGS="-w"
export LDFLAGS+=" -X github.com/docker/docker/dockerversion.Version=%{version}"
export LDFLAGS+=" -X github.com/docker/docker/dockerversion.IAmStatic=false"
export DOCKER_BUILDTAGS="seccomp selinux journald"
export BUILDTAGS="${DOCKER_BUILDTAGS}"
export GOBUILDTAGS="${BUILDTAGS}"
%gobuild -o %{__bindir}/dockerd %{goipath}/docker/cmd/dockerd
)
# buid docker cli
pushd cli-%{version}
export GOPATH="$PWD/.gopath"
mkdir -p $GOPATH/src/%{goipath}
ln -sfn $PWD $GOPATH/src/%{goipath}/cli
export LDFLAGS="-w"
export LDFLAGS+=" -X github.com/docker/cli/cli/version.Version=%{version}"
export BUILDTAGS="pkcs11"
export GOBUILDTAGS="${BUILDTAGS}"
%gobuild -o %{__bindir}/docker %{goipath}/cli/cmd/docker
scripts/docs/generate-man.sh
popd
%install
# install binary
install -Dpm 755 %{__bindir}/docker %{__bindir}/dockerd -t %{buildroot}%{_bindir}/
# install proxy
install -Dpm 755 %{__bindir}/docker-proxy -t %{buildroot}%{_libexecdir}/docker/
# install docker-init
install -Dpm 755 tini-%{tini_version}/%{__cmake_builddir}/tini-static %{buildroot}%{_libexecdir}/docker/docker-init
# install udev rules
install -Dpm 644 contrib/udev/80-docker.rules -t %{buildroot}%{_usr}/lib/udev/rules.d/
# add init scripts
install -Dpm 644 contrib/init/systemd/docker.socket -t %{buildroot}%{_unitdir}/
install -p -m 644 %{SOURCE3} %{buildroot}/%{_unitdir}/docker.service
# for additional args
install -Dpm 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/docker
# Install sysusers configuration
install -Dpm 644 %{SOURCE5} %{buildroot}%{_sysusersdir}/moby-engine.conf
# add bash, zsh, and fish completions
install -Dpm 644 cli-%{version}/contrib/completion/bash/docker -t %{buildroot}%{_datadir}/bash-completion/completions/
install -Dpm 644 cli-%{version}/contrib/completion/zsh/_docker -t %{buildroot}%{_datadir}/zsh/site-functions/
%if %{with fish}
install -Dpm 644 cli-%{version}/contrib/completion/fish/docker.fish -t %{buildroot}%{_datadir}/fish/vendor_completions.d/
%endif
# add nano
install -d %{buildroot}/usr/share/nano
install -p -m 644 contrib/syntax/nano/Dockerfile.nanorc %{buildroot}/usr/share/nano/Dockerfile.nanorc
# install manpages
install -Dpm 644 cli-%{version}/man/man1/*.1 -t %{buildroot}%{_mandir}/man1/
install -Dpm 644 cli-%{version}/man/man5/*.5 -t %{buildroot}%{_mandir}/man5/
install -Dpm 644 cli-%{version}/man/man8/*.8 -t %{buildroot}%{_mandir}/man8/
%pre
%sysusers_create_compat %{SOURCE5}
%post
%systemd_post docker.service docker.socket
%firewalld_reload
%preun
%systemd_preun docker.service docker.socket
%postun
%systemd_postun_with_restart docker.service
%files
%license LICENSE cli-LICENSE
%doc AUTHORS CONTRIBUTING.md MAINTAINERS NOTICE README.md
%doc cli-AUTHORS cli-CONTRIBUTING.md cli-MAINTAINERS cli-NOTICE cli-README.md
%config(noreplace) %{_sysconfdir}/sysconfig/docker
%{_bindir}/docker
%{_bindir}/dockerd
%dir %{_libexecdir}/docker/
%{_libexecdir}/docker/docker-proxy
%{_libexecdir}/docker/docker-init
%{_usr}/lib/udev/rules.d/80-docker.rules
%{_unitdir}/docker.service
%{_unitdir}/docker.socket
%{_sysusersdir}/moby-engine.conf
%{_datadir}/bash-completion/completions/docker
%{_mandir}/man1/docker*.1*
%{_mandir}/man5/{Dockerfile,docker-config-json}.5*
%{_mandir}/man8/dockerd.8*
%files zsh-completion
%{_datadir}/zsh/site-functions/_docker
%if %{with fish}
%files fish-completion
%{_datadir}/fish/vendor_completions.d/docker.fish
%endif
%files nano
%dir %{_datadir}/nano
%{_datadir}/nano/Dockerfile.nanorc
%changelog
* Mon Nov 11 2024 jackeyji <jackeyji@tencent.com> - 27.3.1-1
- [Type] other
- [DESC] upgrade to 27.3.1
* Thu Sep 26 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 25.0.6-4
- Rebuilt for clarifying the packages requirement in BaseOS and AppStream
* Tue Sep 24 2024 jackeyji <jackeyji@tencent.com> - 25.0.6-3
- [Type] other
- [DESC] set default open files ulimits to adapt user case
* Fri Aug 16 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 25.0.6-2
- Rebuilt for loongarch release
* Wed Jul 31 2024 jackeyji <jackeyji@tencent.com> - 25.0.6-1
- [Type] security
- [DESC] upgrade to 25.0.6 to fix CVE-2024-41110
* Tue Jul 16 2024 jackeyji <jackeyji@tencent.com> - 25.0.3-3
- [Type] bugfix
- [DESC] remove default ulimits because it conflict with pam
* Tue Jul 16 2024 jackeyji <jackeyji@tencent.com> - 25.0.3-2
- [Type] other
- [DESC] remove useless require of systemd-rpm-macros
* Tue Feb 27 2024 jackeyji <jackeyji@tencent.com> - 25.0.3-1
- upgrade to 25.0.3 for buildkit CVE-2024-23650 CVE-2024-23651 CVE-2024-23652 and CVE-2024-23653
* Mon Feb 05 2024 jackeyji <jackeyji@tencent.com> - 24.0.5-6
- remove require of libcgroup because systemd is default cgroup driver
* Wed Jan 03 2024 jackeyji <jackeyji@tencent.com> - 24.0.5-5
- use macros of sysusers_create_compat
* Wed Jan 03 2024 jackeyji <jackeyji@tencent.com> - 24.0.5-4
- rectify source file
* Fri Sep 08 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 24.0.5-3
- Rebuilt for OpenCloudOS Stream 23.09
* Mon Aug 07 2023 jackeyji <jackeyji@tencent.com> - 24.0.5-2
- add default service file
* Wed Aug 02 2023 jackeyji <jackeyji@tencent.com> - 24.0.5-1
- upgrade to 24.0.5
* Fri Apr 28 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 20.10.21-6
- Rebuilt for OpenCloudOS Stream 23.05
* Fri Apr 07 2023 rockerzhu <rockerzhu@tencent.com> - 20.10.21-5
- Condflicts with podman.
* Fri Mar 31 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 20.10.21-4
- Rebuilt for OpenCloudOS Stream 23
* Fri Dec 16 2022 Shuo Wang <abushwang@tencent.com> - 20.10.21-3
- apply %gobuild macro
* Fri Dec 16 2022 Shuo Wang <abushwang@tencent.com> - 20.10.21-2
- rename docker to moby & enable man
* Thu Dec 15 2022 Shuo Wang <abushwang@tencent.com> - 20.10.21-1
- initial build
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化