2019-10-10 17:19:05 +03:00
|
|
|
%bcond_with debug
|
|
|
|
|
|
|
|
%if %{with debug}
|
|
|
|
%global _dwz_low_mem_die_limit 0
|
|
|
|
%else
|
|
|
|
%global debug_package %{nil}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if ! 0%{?gobuild:1}
|
|
|
|
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%global import_path github.com/containerd/containerd
|
2019-04-04 10:36:11 +00:00
|
|
|
|
2019-09-05 10:57:58 +03:00
|
|
|
%define oname containerd
|
|
|
|
|
|
|
|
Summary: A daemon to control runC
|
|
|
|
Name: docker-containerd
|
2020-12-16 13:56:56 +03:00
|
|
|
Version: 1.4.3
|
2019-10-10 17:19:05 +03:00
|
|
|
Release: 1
|
2019-09-05 10:57:58 +03:00
|
|
|
License: ASL 2.0
|
|
|
|
Group: System/Kernel and hardware
|
|
|
|
Url: http://www.docker.com
|
2020-11-26 11:41:17 +03:00
|
|
|
%global commit b321d358e6eef9c82fa3f3bb8826dca3724c58c6
|
2019-10-10 17:19:05 +03:00
|
|
|
%global tag v%{version}
|
|
|
|
Source0: https://github.com/containerd/containerd/archive/%{tag}.tar.gz?/%{oname}-%{version}.tar.gz
|
|
|
|
Source1: containerd.service
|
|
|
|
Source2: containerd.toml
|
2019-09-05 10:57:58 +03:00
|
|
|
BuildRequires: glibc-static-devel
|
|
|
|
BuildRequires: golang
|
2017-09-11 14:29:16 +03:00
|
|
|
BuildRequires: btrfs-devel
|
2019-09-05 10:57:58 +03:00
|
|
|
BuildRequires: pkgconfig(libseccomp)
|
2020-11-27 10:00:45 +00:00
|
|
|
Requires: runc
|
2016-06-17 15:20:11 +03:00
|
|
|
|
|
|
|
%description
|
2017-09-11 14:29:16 +03:00
|
|
|
Containerd is a daemon with an API and a command line client, to manage
|
|
|
|
containers on one machine.
|
2016-06-17 15:20:11 +03:00
|
|
|
|
2017-09-11 14:29:16 +03:00
|
|
|
It uses runC to run containers according to the OCI specification.
|
|
|
|
Containerd has advanced features such as seccomp and user namespace
|
|
|
|
support as well as checkpoint and restore for cloning and live migration
|
|
|
|
of containers.
|
2016-06-17 15:20:11 +03:00
|
|
|
|
2019-09-05 10:57:58 +03:00
|
|
|
%files
|
|
|
|
%doc *.md LICENSE NOTICE
|
2019-10-10 17:19:05 +03:00
|
|
|
%{_bindir}/containerd
|
|
|
|
%{_bindir}/containerd-shim
|
|
|
|
%{_bindir}/docker-containerd
|
|
|
|
%{_bindir}/docker-containerd-shim
|
|
|
|
%{_bindir}/ctr
|
|
|
|
%{_unitdir}/containerd.service
|
|
|
|
%dir %{_sysconfdir}/containerd
|
|
|
|
%config(noreplace) %{_sysconfdir}/containerd/config.toml
|
2016-06-17 15:20:11 +03:00
|
|
|
|
2019-09-05 10:57:58 +03:00
|
|
|
#------------------------------------------------------------------
|
2016-06-17 15:20:11 +03:00
|
|
|
|
2019-09-05 10:57:58 +03:00
|
|
|
%prep
|
|
|
|
%setup -qn %{oname}-%{version}
|
2016-06-17 15:20:11 +03:00
|
|
|
|
2019-09-05 10:57:58 +03:00
|
|
|
%build
|
2019-10-10 17:19:05 +03:00
|
|
|
mkdir -p src/%(dirname %{import_path})
|
|
|
|
ln -s ../../.. src/%{import_path}
|
|
|
|
export GOPATH=$(pwd):%{_libdir}/golang
|
|
|
|
export LDFLAGS="-X %{import_path}/version.Package=%{import_path} -X %{import_path}/version.Version=%{tag} -X %{import_path}/version.Revision=%{commit}"
|
|
|
|
go build -o bin/containerd %{import_path}/cmd/containerd
|
|
|
|
go build -o bin/containerd-shim %{import_path}/cmd/containerd-shim
|
|
|
|
go build -o bin/ctr %{import_path}/cmd/ctr
|
2016-06-17 15:20:11 +03:00
|
|
|
|
|
|
|
%install
|
2019-10-10 17:19:05 +03:00
|
|
|
install -D -m 0755 bin/containerd %{buildroot}%{_bindir}/containerd
|
|
|
|
install -D -m 0755 bin/containerd-shim %{buildroot}%{_bindir}/containerd-shim
|
|
|
|
install -D -m 0755 bin/ctr %{buildroot}%{_bindir}/ctr
|
|
|
|
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/containerd.service
|
|
|
|
install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/containerd/config.toml
|
|
|
|
|
|
|
|
ln -s containerd %{buildroot}%{_bindir}/docker-containerd
|
|
|
|
ln -s containerd-shim %{buildroot}%{_bindir}/docker-containerd-shim
|
|
|
|
|
|
|
|
%post
|
|
|
|
%systemd_post containerd.service
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%systemd_preun containerd.service
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%systemd_postun_with_restart containerd.service
|