From: Marcin Krol Date: Sun, 18 Jan 2026 14:38:33 +0000 (+0100) Subject: - from PLD, TLDized X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=a881d8699d8a258de84022a3dcba6488fa5218f4;p=packages%2Fdocker-ce.git - from PLD, TLDized --- a881d8699d8a258de84022a3dcba6488fa5218f4 diff --git a/docker-ce.spec b/docker-ce.spec new file mode 100644 index 0000000..446f36c --- /dev/null +++ b/docker-ce.spec @@ -0,0 +1,152 @@ +Summary: Docker CE: the open-source application container engine +Name: docker-ce +Version: 28.3.0 +Release: 1 +License: Apache v2.0 +Group: Applications/System +# https://github.com/moby/moby/releases +Source0: https://github.com/moby/moby/archive/v%{version}/%{name}-%{version}.tar.gz +# Source0-md5: 87a336d8939e50bd34526d748d33faeb +Source1: dockerd.sh +Source2: docker.init +Source3: docker.sysconfig +URL: https://www.docker.com/ +BuildRequires: golang >= 1.21 +BuildRequires: linux-libc-headers >= 7:4.12 +BuildRequires: rpm-build >= 4.6 +BuildRequires: rpmbuild(macros) >= 2.009 +Requires(post,preun): /sbin/chkconfig +Requires(postun): /usr/sbin/groupdel +Requires(pre): /usr/bin/getgid +Requires(pre): /usr/sbin/groupadd +Requires: ca-certificates +Requires: containerd >= 1.6.22 +Requires: iproute2 >= 3.5 +Requires: iptables >= 1.4 +Requires: procps +Requires: rc-scripts >= 0.4.0.10 +Requires: tini +Requires: uname(release) >= 3.8 +Suggests: docker-ce-cli +Suggests: pigz +Suggests: xfsprogs +Suggests: xz >= 1:4.9 +Suggests: zfs +Provides: docker = %{version} +Provides: docker(engine) = %{version} +Provides: group(docker) +Obsoletes: docker < 18.0 +Obsoletes: lxc-docker < 1.1.1 +ExclusiveArch: %go_arches +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%define _libexecdir %{_prefix}/lib + +# binary stripped or something +%define _enable_debug_packages 0 + +%description +Docker is an open source project to pack, ship and run any application +as a lightweight container + +Docker containers are both hardware-agnostic and platform-agnostic. +This means that they can run anywhere, from your laptop to the largest +EC2 compute instance and everything in between - and they don't +require that you 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. + +Docker is an open-source implementation of the deployment engine which +powers dotCloud, a popular Platform-as-a-Service. It benefits directly +from the experience accumulated over several years of large-scale +operation and support of hundreds of thousands of applications and +databases. + +%prep +%setup -q -n moby-%{version} +%patch -P0 -p1 + +%build +export VERSION=%{version} +export DOCKER_GITCOMMIT="TLD-Linux/%{version}" +export GO111MODULE=off + +AUTO_GOPATH=1 \ +bash -x hack/make.sh dynbinary +./bundles/dynbinary-daemon/dockerd -v + +%install +rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig}} \ + $RPM_BUILD_ROOT%{_sysconfdir}/docker \ + $RPM_BUILD_ROOT%{_libexecdir} \ + $RPM_BUILD_ROOT/var/lib/docker/{containers,execdriver,graph,image,init,network,swarm,tmp,trust,vfs,volumes} + +install -p bundles/dynbinary-daemon/docker-proxy $RPM_BUILD_ROOT%{_sbindir}/docker-proxy +install -p bundles/dynbinary-daemon/dockerd $RPM_BUILD_ROOT%{_sbindir}/dockerd +%{__ln_s} /sbin/tini $RPM_BUILD_ROOT%{_sbindir}/docker-init +install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker +install -p %{SOURCE1} $RPM_BUILD_ROOT%{_libexecdir}/dockerd +cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/docker + +# install udev rules +install -d $RPM_BUILD_ROOT/lib/udev/rules.d +cp -p contrib/udev/80-docker.rules $RPM_BUILD_ROOT/lib/udev/rules.d + +%pre +%groupadd -g 296 docker + +%post +/sbin/chkconfig --add docker +%service -n docker restart + +%preun +if [ "$1" = "0" ]; then + %service -q docker stop + /sbin/chkconfig --del docker +fi + +%postun +if [ "$1" = "0" ]; then + %groupremove docker +fi + +%triggerun -- docker < 17.0 +# Prevent preun from docker from working +chmod a-x /etc/rc.d/init.d/docker + +%triggerpostun -- docker < 17.0 +# Restore what triggerun removed +chmod 754 /etc/rc.d/init.d/docker +# reinstall docker init.d links, which could be different +/sbin/chkconfig --del docker +/sbin/chkconfig --add docker + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(644,root,root,755) +%doc README.md CONTRIBUTING.md LICENSE AUTHORS NOTICE MAINTAINERS +%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/docker +%attr(754,root,root) /etc/rc.d/init.d/docker +%dir %{_sysconfdir}/docker +%attr(755,root,root) %{_sbindir}/docker-init +%attr(755,root,root) %{_sbindir}/docker-proxy +%attr(755,root,root) %{_sbindir}/dockerd +%attr(755,root,root) %{_libexecdir}/dockerd +/lib/udev/rules.d/80-docker.rules + +%dir %attr(700,root,root) /var/lib/docker +%dir %attr(700,root,root) /var/lib/docker/containers +%dir %attr(700,root,root) /var/lib/docker/execdriver +%dir %attr(700,root,root) /var/lib/docker/graph +%dir %attr(700,root,root) /var/lib/docker/image +%dir %attr(700,root,root) /var/lib/docker/init +%dir %attr(700,root,root) /var/lib/docker/network +%dir %attr(700,root,root) /var/lib/docker/swarm +%dir %attr(700,root,root) /var/lib/docker/tmp +%dir %attr(700,root,root) /var/lib/docker/trust +%dir %attr(700,root,root) /var/lib/docker/vfs +%dir %attr(700,root,root) /var/lib/docker/volumes diff --git a/docker.init b/docker.init new file mode 100755 index 0000000..a3ee788 --- /dev/null +++ b/docker.init @@ -0,0 +1,113 @@ +#!/bin/sh +# +# Create lightweight, portable, self-sufficient containers. +# +# chkconfig: 345 20 80 +# +# description: Docker is an open-source project to easily create lightweight, portable, \ +# self-sufficient containers from any application. The same container that a \ +# developer builds and tests on a laptop can run at scale, in production, on \ +# VMs, bare metal, OpenStack clusters, public clouds and more. \ +# processname: docker +# pidfile: /var/run/docker.pid +# + +# Source function library +. /etc/rc.d/init.d/functions + +# Get network config +. /etc/sysconfig/network + +# Check that networking is up. +if is_yes "${NETWORKING}"; then + if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then + msg_network_down "Docker" + exit 1 + fi +else + exit 0 +fi + +DOCKER_LOGFILE=/var/log/docker.log + +# Get service config - may override defaults +[ -f /etc/sysconfig/docker ] && . /etc/sysconfig/docker + +pidfile="/var/run/docker.pid" + +start() { + # Check if the service is already running? + if [ -f /var/lock/subsys/docker ]; then + msg_already_running "Docker" + return + fi + + # NOTE: docker daemon actually doesn't go to background, need to do that ourselves + # https://github.com/docker/docker/issues/2758 + + msg_starting "Docker" + + touch "$DOCKER_LOGFILE" + chgrp docker "$DOCKER_LOGFILE" + + export DOCKER_LOGFILE + daemon \ + --fork --pidfile $pidfile --waitfortime 60 \ + /usr/lib/dockerd $OPTIONS + + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/docker +} + +stop() { + if [ ! -f /var/lock/subsys/docker ]; then + msg_not_running "Docker" + return + fi + + # Stop daemons. + msg_stopping "Docker" + killproc --pidfile $pidfile docker + rm -f /var/lock/subsys/docker +} + +condrestart() { + if [ ! -f /var/lock/subsys/docker ]; then + msg_not_running "Docker" + RETVAL=$1 + return + fi + + stop + start +} + +RETVAL=0 +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + try-restart) + condrestart 0 + ;; + force-reload) + condrestart 7 + ;; + status) + status --pidfile $pidfile docker docker + RETVAL=$? + ;; + *) + msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" + exit 3 +esac + +exit $RETVAL diff --git a/docker.sysconfig b/docker.sysconfig new file mode 100644 index 0000000..1b5cfc4 --- /dev/null +++ b/docker.sysconfig @@ -0,0 +1,23 @@ +# Customized settings for Docker + +# Define nice level for docker +SERVICE_RUN_NICE_LEVEL="+0" + +# Setup bigger Max open files and Max processes +SERVICE_LIMITS="-n 1048576 -u 1048576" + +# Modify these options if you want to change the way the docker daemon runs +# IMPORTANT: +# When using systemd, do not use variables in variables: +# OPTIONS="$OPTIONS --foo" +# ... systemd parser does not handle these +#OPTIONS="" + +# Use overlay storage driver +#OPTIONS="$OPTIONS --storage-driver=overlay" + +# https://github.com/docker/docker-ce/blob/master/components/cli/experimental/README.md +#OPTIONS="$OPTIONS --experimental" + +# Mirror local registry in intranet which has no ssl cert +#OPTIONS="$OPTIONS --insecure-registry registry.example.lan:5000 --registry-mirror http://registry.example.lan:5000" diff --git a/dockerd.sh b/dockerd.sh new file mode 100755 index 0000000..224c705 --- /dev/null +++ b/dockerd.sh @@ -0,0 +1,4 @@ +#!/bin/sh +exec 1>>$DOCKER_LOGFILE +exec 2>&1 +exec /usr/sbin/dockerd "$@"