diff --git a/cli-20.10.21.tar.gz b/cli-20.10.21.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..50984e80c9f92f311f6781318ac345a23e127b13 Binary files /dev/null and b/cli-20.10.21.tar.gz differ diff --git a/docker.service b/docker.service new file mode 100644 index 0000000000000000000000000000000000000000..b5400bbba3ec471c434392b53b3da38bdbd185a7 --- /dev/null +++ b/docker.service @@ -0,0 +1,47 @@ +[Unit] +Description=Docker Application Container Engine +Documentation=https://docs.docker.com +After=network-online.target docker.socket firewalld.service containerd.service +Wants=network-online.target +Requires=docker.socket containerd.service + +[Service] +Type=notify +# the default is not to use systemd for cgroups because the delegate issues still +# exists and systemd currently does not support the cgroup feature set required +# for containers run by docker +ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock +ExecReload=/bin/kill -s HUP $MAINPID +TimeoutSec=0 +RestartSec=2 +Restart=always + +# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229. +# Both the old, and new location are accepted by systemd 229 and up, so using the old location +# to make them work for either version of systemd. +StartLimitBurst=3 + +# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230. +# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make +# this option work for either version of systemd. +StartLimitInterval=60s + +# Having non-zero Limit*s causes performance problems due to accounting overhead +# in the kernel. We recommend using cgroups to do container-local accounting. +LimitNOFILE=infinity +LimitNPROC=infinity +LimitCORE=infinity + +# Comment TasksMax if your systemd version does not support it. +# Only systemd 226 and above support this option. +TasksMax=infinity + +# set delegate yes so that systemd does not reset the cgroups of docker containers +Delegate=yes + +# kill only the docker process, not all processes in the cgroup +KillMode=process +OOMScoreAdjust=-500 + +[Install] +WantedBy=multi-user.target diff --git a/docker.socket b/docker.socket new file mode 100644 index 0000000000000000000000000000000000000000..9db5049150453ad8f04fcbfd0efe9a7c2c31a647 --- /dev/null +++ b/docker.socket @@ -0,0 +1,11 @@ +[Unit] +Description=Docker Socket for the API + +[Socket] +ListenStream=/var/run/docker.sock +SocketMode=0660 +SocketUser=root +SocketGroup=docker + +[Install] +WantedBy=sockets.target diff --git a/libnetwork-dcdf8f17.tar.gz b/libnetwork-dcdf8f17.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f6c37a44c86497323fb2373a55d5c77cdc204c17 Binary files /dev/null and b/libnetwork-dcdf8f17.tar.gz differ diff --git a/moby-20.10.21.tar.gz b/moby-20.10.21.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..921de4626e57de4ce6b9b119e0e3d6cad33053b5 Binary files /dev/null and b/moby-20.10.21.tar.gz differ diff --git a/moby.spec b/moby.spec new file mode 100644 index 0000000000000000000000000000000000000000..721785ab7aa7b0ad1d8117def9c3cf52b2f69e2d --- /dev/null +++ b/moby.spec @@ -0,0 +1,198 @@ +%global _gitcommit_engine a89b8422 +%global _gitcommit_cli 100c7018 +%global _source_engine moby-%{version} +%global _source_client cli-%{version} +%global _source_docker_init tini-0.19.0 +%global _source_docker_proxy libnetwork-dcdf8f17 + +Name: docker +Version: 20.10.21 +Release: 1 +Summary: The open-source application container engine +License: ASL 2.0 +URL: https://www.docker.com +# https://github.com/docker/cli/archive/refs/tags/v20.10.21.tar.gz +Source0: cli-%{version}.tar.gz +# https://github.com/moby/moby/archive/refs/tags/v20.10.21.tar.gz +Source1: moby-%{version}.tar.gz +# https://github.com/krallin/tini/archive/refs/tags/v0.19.0.tar.gz +Source2: tini-0.19.0.tar.gz +# https://github.com/moby/libnetwork @dcdf8f176d1e13ad719e913e796fb698d846de98 +Source3: libnetwork-dcdf8f17.tar.gz +Source4: docker.service +Source5: docker.socket + +Requires: %{name}-engine = %{version}-%{release} +Requires: %{name}-client = %{version}-%{release} + +# conflicting packages +Conflicts: docker-ce +Conflicts: docker-io +Conflicts: docker-engine-cs +Conflicts: docker-ee + +%description +Docker is a product for you to build, ship and run any application as a +lightweight container. + +%package engine +Summary: Docker daemon binary and related utilities + +Requires: /usr/sbin/groupadd +Requires: docker-client +Requires: container-selinux >= 2:2.74 +Requires: libseccomp >= 2.3 +Requires: systemd +Requires: iptables +Requires: libcgroup +Requires: containerd >= 1.4.1 +Requires: tar +Requires: xz + +BuildRequires: bash +BuildRequires: ca-certificates +BuildRequires: cmake +BuildRequires: device-mapper-devel +BuildRequires: gcc +BuildRequires: git +BuildRequires: glibc-static +BuildRequires: libarchive +BuildRequires: libseccomp-devel +BuildRequires: libselinux-devel +BuildRequires: libtool +BuildRequires: libtool-ltdl-devel +BuildRequires: make +BuildRequires: pkgconfig +BuildRequires: pkgconfig(systemd) +BuildRequires: selinux-policy-devel +BuildRequires: systemd-devel +BuildRequires: tar +BuildRequires: which +BuildRequires: golang >= 1.18 + +%description engine +Docker daemon binary and related utilities + +%package client +Summary: Docker client binary and related utilities + +Requires: /bin/sh +BuildRequires: libtool-ltdl-devel + +%description client +Docker client binary and related utilities + +%prep +%setup -q -n %{_source_client} +%setup -q -T -n %{_source_engine} -b 1 +%setup -q -T -n %{_source_docker_init} -b 2 +%setup -q -T -n %{_source_docker_proxy} -b 3 + +%build +export GO111MODULE=off +# build docker daemon +export DOCKER_GITCOMMIT=%{_gitcommit_engine} +export DOCKER_BUILDTAGS="exclude_graphdriver_btrfs" + +pushd %{_builddir}/%{_source_engine} +AUTO_GOPATH=1 VERSION=%{version} PRODUCT=docker hack/make.sh dynbinary +popd + +# build docker-tini +pushd %{_builddir}/%{_source_docker_init} +cmake . +make tini-static +popd + +# build docker-proxy +pushd %{_builddir}/%{_source_docker_proxy} +mkdir -p .gopath/src/github.com/docker/libnetwork +export GOPATH=`pwd`/.gopath +rm -rf .gopath/src/github.com/docker/libnetwork +ln -s %{_builddir}/%{_source_docker_proxy} .gopath/src/github.com/docker/libnetwork +pushd .gopath/src/github.com/docker/libnetwork +go build -buildmode=pie -ldflags=-linkmode=external -o docker-proxy github.com/docker/libnetwork/cmd/proxy +popd +popd + +# build cli +pushd %{_builddir}/%{_source_client} +mkdir -p .gopath/src/github.com/docker/cli +export GOPATH=`pwd`/.gopath +rm -rf .gopath/src/github.com/docker/cli +ln -s %{_builddir}/%{_source_client} .gopath/src/github.com/docker/cli +pushd .gopath/src/github.com/docker/cli +DISABLE_WARN_OUTSIDE_CONTAINER=1 make VERSION=%{version} GITCOMMIT=%{_gitcommit_cli} dynbinary +popd +popd + +%check +# check for daemon +ver="$(%{_builddir}/%{_source_engine}/bundles/dynbinary-daemon/dockerd --version)"; \ + test "$ver" = "Docker version %{version}, build %{_gitcommit_engine}" && echo "PASS: daemon version OK" || (echo "FAIL: daemon version ($ver) did not match" && exit 1) +# check for client +ver="$(%{_builddir}/%{_source_client}/build/docker --version)"; \ + test "$ver" = "Docker version %{version}, build %{_gitcommit_cli}" && echo "PASS: cli version OK" || (echo "FAIL: cli version ($ver) did not match" && exit 1) + + +%install +# install daemon binary +install -D -p -m 0755 $(readlink -f %{_builddir}/%{_source_engine}/bundles/dynbinary-daemon/dockerd) %{buildroot}%{_bindir}/dockerd + +# install proxy +install -D -p -m 0755 %{_builddir}/%{_source_docker_proxy}/docker-proxy %{buildroot}%{_bindir}/docker-proxy + +# install tini +install -D -p -m 755 %{_builddir}/%{_source_docker_init}/tini-static %{buildroot}%{_bindir}/docker-init + +# install systemd scripts +install -D -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/docker.service +install -D -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/docker.socket + +# install docker client +install -p -m 0755 $(readlink -f %{_builddir}/%{_source_client}/build/docker) %{buildroot}%{_bindir}/docker + +# add bash, zsh, and fish completions +install -d %{buildroot}%{_datadir}/bash-completion/completions +install -d %{buildroot}%{_datadir}/zsh/vendor-completions +install -d %{buildroot}%{_datadir}/fish/vendor_completions.d +install -p -m 644 %{_builddir}/%{_source_client}/contrib/completion/bash/docker %{buildroot}%{_datadir}/bash-completion/completions/docker +install -p -m 644 %{_builddir}/%{_source_client}/contrib/completion/zsh/_docker %{buildroot}%{_datadir}/zsh/vendor-completions/_docker +install -p -m 644 %{_builddir}/%{_source_client}/contrib/completion/fish/docker.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/docker.fish + +# add docs +install -d %{buildroot}%{_pkgdocdir} +install -p -m 644 %{_builddir}/%{_source_client}/{LICENSE,MAINTAINERS,NOTICE,README.md} %{buildroot}%{_pkgdocdir} + +%files +# empty as it depends on engine and client + +%files engine +%{_bindir}/dockerd +%{_bindir}/docker-proxy +%{_bindir}/docker-init +%{_unitdir}/docker.service +%{_unitdir}/docker.socket + +%files client +%{_bindir}/docker +%{_datadir}/bash-completion/completions/docker +%{_datadir}/zsh/vendor-completions/_docker +%{_datadir}/fish/vendor_completions.d/docker.fish +%doc %{_pkgdocdir} + +%post +%systemd_post docker.service +if ! getent group docker > /dev/null; then + groupadd --system docker +fi + +%preun +%systemd_preun docker.service + +%postun +%systemd_postun_with_restart docker.service + +%changelog +* Thu 14 2022 wanglimin - 20.10.21-1 +- DESC: initial docker-20.10.21-1 diff --git a/tini-0.19.0.tar.gz b/tini-0.19.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2966c7b53c3f8f5d0d2f18986e4955612fb14519 Binary files /dev/null and b/tini-0.19.0.tar.gz differ