From 1f2ecae2584aab40253c7f2fc41756b5bd91ca52 Mon Sep 17 00:00:00 2001 From: "survolog (Andrey Grigorev)" Date: Wed, 14 Aug 2019 15:38:32 +0300 Subject: [PATCH] Update to 19.03.1 --- .abf.yml | 6 +- adjust-docker-service.patch | 17 -- docker-network-cleanup.sh | 3 + docker-network.sysconfig | 3 + docker-storage.sysconfig | 12 + docker.conf | 11 - docker.rpmlintrc | 1 + docker.service | 31 +++ docker.socket | 12 + docker.spec | 462 +++++++++++++----------------------- docker.sysconfig | 22 ++ overlay.conf | 1 + 12 files changed, 260 insertions(+), 321 deletions(-) delete mode 100644 adjust-docker-service.patch create mode 100644 docker-network-cleanup.sh create mode 100644 docker-network.sysconfig create mode 100644 docker-storage.sysconfig delete mode 100644 docker.conf create mode 100644 docker.service create mode 100644 docker.socket create mode 100644 docker.sysconfig create mode 100644 overlay.conf diff --git a/.abf.yml b/.abf.yml index 472650d..b80d286 100644 --- a/.abf.yml +++ b/.abf.yml @@ -1,3 +1,5 @@ sources: - libnetwork-20170523.tar.xz: 1d6cfa291a9ed3b83fa9d5a35f3ae5064716a0ab - v17.05.0-ce.tar.gz: 809551f715da02f40f6c8c7b25ef19717da3b2aa + docker-ce-19.03.1.tar.gz: ea6221d6a0e04781f1df7da44bf8190b191e1292 + libnetwork-master.zip: 03004a4f59a64a861277a932871610186a38f10d + tini-0.18.0.tar.gz: 27b7529ae87ea688e21d0a061b6d9299ff9362f6 + diff --git a/adjust-docker-service.patch b/adjust-docker-service.patch deleted file mode 100644 index ee3bf9a..0000000 --- a/adjust-docker-service.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/contrib/init/systemd/docker.service.rpm b/contrib/init/systemd/docker.service.rpm -index 08e90da..b6ff8c7 100644 ---- a/contrib/init/systemd/docker.service.rpm -+++ b/contrib/init/systemd/docker.service.rpm -@@ -5,10 +5,11 @@ After=network.target - - [Service] - Type=notify -+EnvironmentFile=-/etc/sysconfig/docker - # 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 -+ExecStart=/usr/bin/dockerd $DOCKER_OPTS $DATA_ROOT - ExecReload=/bin/kill -s HUP $MAINPID - # Having non-zero Limit*s causes performance problems due to accounting overhead - # in the kernel. We recommend using cgroups to do container-local accounting. diff --git a/docker-network-cleanup.sh b/docker-network-cleanup.sh new file mode 100644 index 0000000..97f4cac --- /dev/null +++ b/docker-network-cleanup.sh @@ -0,0 +1,3 @@ +#!/bin/sh +rm -rf /etc/sysconfig/network-scripts/ifcfg-*veth* +rm -rf /etc/sysconfig/network-scripts/ifcfg-*docker* diff --git a/docker-network.sysconfig b/docker-network.sysconfig new file mode 100644 index 0000000..b82627c --- /dev/null +++ b/docker-network.sysconfig @@ -0,0 +1,3 @@ +# /etc/sysconfig/docker-network +# It's convenient to have docker listening on a tcp port so add it +DOCKER_NETWORK_OPTIONS=-H unix://var/run/docker.sock -H tcp://127.0.0.1:2375 diff --git a/docker-storage.sysconfig b/docker-storage.sysconfig new file mode 100644 index 0000000..699203a --- /dev/null +++ b/docker-storage.sysconfig @@ -0,0 +1,12 @@ +# This file may be automatically generated by an installation program. + +# By default, Docker uses a loopback-mounted sparse file in +# /var/lib/docker. The loopback makes it slower, and there are some +# restrictive defaults, such as 100GB max storage. + +# If your installation did not set a custom storage for Docker, you +# may do it below. + +# Example: Use a custom pair of raw logical volumes (one for metadata, +# one for data). +# DOCKER_STORAGE_OPTIONS = --storage-opt dm.metadatadev=/dev/mylogvol/my-docker-metadata --storage-opt dm.datadev=/dev/mylogvol/my-docker-data diff --git a/docker.conf b/docker.conf deleted file mode 100644 index 6c4d3db..0000000 --- a/docker.conf +++ /dev/null @@ -1,11 +0,0 @@ -# Use DOCKER_OPTS to modify the daemon startup options. -# DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4" -# set overlayfs if you need -DOCKER_OPTS="--storage-driver=overlay2" -DATA_ROOT="--data-root /var/lib/docker" - -# If you need Docker to use an HTTP proxy, it can also be specified here. -#export http_proxy="http://127.0.0.1:3128/" - -# This is also a handy place to tweak where Docker's temporary files go. -#export TMPDIR="/mnt/bigdrive/docker-tmp" diff --git a/docker.rpmlintrc b/docker.rpmlintrc index f3e0e3d..a0d9f16 100644 --- a/docker.rpmlintrc +++ b/docker.rpmlintrc @@ -1,2 +1,3 @@ # modifying the dockerinit binary breaks the SHA1 sum check by docker addFilter("unstripped-binary-or-object") + diff --git a/docker.service b/docker.service new file mode 100644 index 0000000..3f563cb --- /dev/null +++ b/docker.service @@ -0,0 +1,31 @@ +[Unit] +Description=Docker Application Container Engine +Documentation=http://docs.docker.com +After=network.target +Wants=docker-storage-setup.service + +[Service] +Type=notify +EnvironmentFile=-/etc/sysconfig/docker +EnvironmentFile=-/etc/sysconfig/docker-storage +EnvironmentFile=-/etc/sysconfig/docker-network +Environment=GOTRACEBACK=crash +ExecStart=/usr/sbin/dockerd \ + $OPTIONS \ + $DOCKER_STORAGE_OPTIONS \ + $DOCKER_NETWORK_OPTIONS \ + $INSECURE_REGISTRY +TasksMax=8192 +LimitNOFILE=1048576 +LimitNPROC=1048576 +LimitCORE=infinity +MountFlags=slave +TimeoutStartSec=0 +Restart=on-abnormal + +ExecStartPre=/usr/sbin/docker-network-cleanup +ExecStopPost=/usr/sbin/docker-network-cleanup + +[Install] +WantedBy=multi-user.target + diff --git a/docker.socket b/docker.socket new file mode 100644 index 0000000..90937d6 --- /dev/null +++ b/docker.socket @@ -0,0 +1,12 @@ +[Unit] +Description=Docker Socket for the API +PartOf=docker.service + +[Socket] +ListenStream=/run/docker.sock +SocketMode=0660 +SocketUser=root +SocketGroup=docker + +[Install] +WantedBy=sockets.target diff --git a/docker.spec b/docker.spec index 05c20ec..35075ee 100644 --- a/docker.spec +++ b/docker.spec @@ -1,85 +1,58 @@ -# modifying the dockerinit binary breaks the SHA1 sum check by docker -%global __os_install_post %{_usrlibrpm}/brp-compress -%global dist_version 17.05.0 - - -# docker builds in a checksum of dockerinit into docker, -# so stripping the binaries breaks docker -#debuginfo not supported with Go -%global debug_package %{nil} -%global provider github -%global provider_tld com -%global project docker -%global repo %{project} -%global import_path %{provider}.%{provider_tld}/%{project}/%{repo} - - -%global gopath %{_libdir}/golang -%define gosrc %{gopath}/src/pkg/%{import_path} -%define go_dir %{gopath} - -%global commit 4dc5990d7565a4a15d641bc6a0bc50a02cfcf302 -%global shortcommit %(c=%{commit}; echo ${c:0:7}) - %define __noautoreq '.*/bin/make' -%define libnetwork_date 20170523 +# modifying the dockerinit binary breaks the SHA1 sum check by docker +%global __os_install_post %{_usrlibrpm}/brp-compress +%define debug_package %{nil} -Name: docker -Version: %{dist_version} -Release: 4 -Summary: Automates deployment of containerized applications -License: ASL 2.0 +%global commit 89658bed64c2a8fe05a978e5b87dbec409d57a0f +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + +Summary: Automates deployment of containerized applications +Name: docker +Version: 19.03.1 +Release: 1 +License: ASL 2.0 Group: System/Kernel and hardware - -URL: http://www.docker.com +Url: http://www.docker.com # only x86_64 for now: https://github.com/docker/docker/issues/136 -#ExclusiveArch: x86_64 -Source0: https://%{import_path}/archive/v%{dist_version}-ce.tar.gz -Source2: docker.conf -Source3: libnetwork-20170523.tar.xz -Patch0: adjust-docker-service.patch +#ExclusiveArch: x86_64 +Source0: https://github.com/docker/docker-ce/archive/v%{version}.tar.gz?/%{name}-ce-%{version}.tar.gz +Source1: %{name}.service +Source2: %{name}.sysconfig +Source3: %{name}-storage.sysconfig +Source6: %{name}-network.sysconfig +Source7: %{name}.socket +Source8: %{name}-network-cleanup.sh +Source9: overlay.conf +# 7f13a5c99f4bb76a4122035d495984b6a09739bb +Source10: https://github.com/docker/libnetwork/archive/master.zip?/libnetwork-master.zip +Source11: https://github.com/krallin/tini/archive/v0.18.0.tar.gz?/tini-0.18.0.tar.gz Source100: %{name}.rpmlintrc - -BuildRequires: gcc -BuildRequires: glibc-static-devel - -# ensure build uses golang 1.4 or above -BuildRequires: golang >= 1.4 +BuildRequires: cmake +BuildRequires: go-md2man +BuildRequires: golang +BuildRequires: systemd +BuildRequires: btrfs-devel +BuildRequires: glibc-devel +BuildRequires: glibc-static-devel +BuildRequires: libtool-devel +BuildRequires: pkgconfig(devmapper) +BuildRequires: pkgconfig(libseccomp) BuildRequires: pkgconfig(sqlite3) - +BuildRequires: pkgconfig(systemd) +Requires: bridge-utils +Requires: %{name}-containerd Requires: runc - -BuildRequires: golang-net-devel -BuildRequires: go-md2man -BuildRequires: device-mapper-devel -BuildRequires: btrfs-devel -BuildRequires: pkgconfig(systemd) -BuildRequires: pkgconfig(libsystemd) -Requires: systemd-units - -# With docker >= 1.11 you now need containerd (and runC as a dep) -Requires: docker-containerd >= 0.2.5 - # need xz to work with ubuntu images # https://bugzilla.redhat.com/show_bug.cgi?id=1045220 -Requires: xz - -# https://bugzilla.redhat.com/show_bug.cgi?id=1035436 -# this won't be needed for rhel7+ -Requires: bridge-utils -Requires: lxc - +Requires: xz +Requires(pre): rpm-helper +Requires(post,preun,postun): systemd # https://bugzilla.redhat.com/show_bug.cgi?id=1034919 # No longer needed in Fedora because of libcontainer -Requires: cgroup -Requires: e2fsprogs -Requires: iptables - - -Obsoletes: docker-io < 1.2.0-8 -Provides: docker-io = %{version}-%{release} +Provides: lxc-%{name} = %{EVRD} +Provides: %{name}-swarm = %{EVRD} %description Docker is an open-source engine that automates the deployment of any @@ -91,285 +64,192 @@ and between virtually any server. The same container that a developer builds and tests on a laptop will run at scale, in production*, on VMs, bare-metal servers, OpenStack clusters, public instances, or combinations of the above. -%package devel -BuildRequires: golang >= 1.4 -Requires: golang >= 1.4 -Requires: docker-pkg-devel -Summary: A golang registry for global request variables (source libraries) -Provides: %{repo}-pkg-devel = %{version}-%{release} -Provides: golang(%{import_path}) = %{version}-%{release} -Provides: golang(%{import_path}/api) = %{version}-%{release} -Provides: golang(%{import_path}/api/client) = %{version}-%{release} -Provides: golang(%{import_path}/api/server) = %{version}-%{release} -Provides: golang(%{import_path}/api/types) = %{version}-%{release} -Provides: golang(%{import_path}/archive) = %{version}-%{release} -Provides: golang(%{import_path}/builtins) = %{version}-%{release} -Provides: golang(%{import_path}/contrib) = %{version}-%{release} -Provides: golang(%{import_path}/contrib/docker-device-tool) = %{version}-%{release} -Provides: golang(%{import_path}/contrib/host-integration) = %{version}-%{release} -Provides: golang(%{import_path}/daemon) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/execdriver) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/execdriver/execdrivers) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/execdriver/lxc) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/execdriver/native) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/execdriver/native/template) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/graphdriver) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/graphdriver/aufs) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/graphdriver/btrfs) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/graphdriver/devmapper) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/graphdriver/overlay) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/graphdriver/graphtest) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/graphdriver/vfs) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/logger) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/logger/jsonfilelog) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/logger/syslog) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/networkdriver) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/networkdriver/bridge) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/networkdriver/ipallocator) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/networkdriver/portallocator) = %{version}-%{release} -Provides: golang(%{import_path}/daemon/networkdriver/portmapper) = %{version}-%{release} -Provides: golang(%{import_path}/dockerversion) = %{version}-%{release} -Provides: golang(%{import_path}/engine) = %{version}-%{release} -Provides: golang(%{import_path}/graph) = %{version}-%{release} -Provides: golang(%{import_path}/image) = %{version}-%{release} -Provides: golang(%{import_path}/integration) = %{version}-%{release} -Provides: golang(%{import_path}/integration-cli) = %{version}-%{release} -Provides: golang(%{import_path}/links) = %{version}-%{release} -Provides: golang(%{import_path}/nat) = %{version}-%{release} -Provides: golang(%{import_path}/opts) = %{version}-%{release} -Provides: golang(%{import_path}/pkg) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/term) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/term/winconsole) = %{version}-%{release} -Provides: golang(%{import_path}/registry) = %{version}-%{release} -Provides: golang(%{import_path}/registry/v2) = %{version}-%{release} -Provides: golang(%{import_path}/runconfig) = %{version}-%{release} -Provides: golang(%{import_path}/utils) = %{version}-%{release} -Provides: golang(%{import_path}/utils/broadcastwriter) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/graphdb) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/iptables) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/listenbuffer) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/mflag) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/mflag/example) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/mount) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/namesgenerator) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/networkfs/etchosts) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/networkfs/resolvconf) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/proxy) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/signal) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/symlink) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/sysinfo) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/system) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/systemd) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/tailfile) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/term) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/testutils) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/truncindex) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/units) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/user) = %{version}-%{release} -Provides: golang(%{import_path}/pkg/version) = %{version}-%{release} +%files +%doc CHANGELOG.md CONTRIBUTING.md README.md +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-network +%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-storage +%{_bindir}/%{name} +%{_bindir}/%{name}-proxy +%{_bindir}/%{name}-init +%{_sbindir}/%{name}-network-cleanup +%{_sbindir}/%{name}d +%{_presetdir}/86-%{name}.preset +%{_unitdir}/%{name}.service +%{_unitdir}/%{name}.socket +%dir %{_sysconfdir}/bash_completion.d +%{_sysconfdir}/bash_completion.d/%{name}.bash +%dir %{_localstatedir}/lib/%{name} +%dir %{_udevrulesdir} +%{_udevrulesdir}/80-%{name}.rules +%{_sysconfdir}/modules-load.d/overlay.conf -%description devel -This is the source libraries for docker. +%pre +getent group %{name} > /dev/null || %{_sbindir}/groupadd -r %{name} +exit 0 + +%post +%systemd_post %{name} + +%preun +%systemd_preun %{name} + +%postun +%systemd_postun_with_restart %{name} + +#------------------------------------------------------------------ %package fish-completion -Summary: Fish completion files for Docker -Requires: %{repo} = %{version}-%{release} -# fish is in contrib, but we can't move this particular -# subpackage there, so suggest fish instead of require -Suggests: fish -Provides: %{repo}-io-fish-completion = %{version}-%{release} +Summary: Fish completion files for Docker +Group: System/Kernel and hardware +Requires: %{name} = %{EVRD} +Suggests: fish +Provides: %{name}-io-fish-completion = %{EVRD} %description fish-completion This package installs %{summary}. -%package logrotate -Summary: Cron job to run logrotate on Docker containers -Requires: %{repo} = %{version}-%{release} -Provides: %{repo}-io-logrotate = %{version}-%{release} +%files fish-completion +%doc README.md +%dir %{_datadir}/fish/vendor_completions.d/ +%{_datadir}/fish/vendor_completions.d/%{name}.fish -%description logrotate -This package installs a cron job to run logrotate on Docker containers. -Logrotate is assumed to be installed on containers for this to work, -failures are silently ignored. - -%package unit-test -Summary: Cron job for running unit tests - -%description unit-test -%{summary} - for running unit tests +#------------------------------------------------------------------ %package vim -Summary: Vim syntax highlighting files for Docker -Requires: %{repo} = %{version}-%{release} -Requires: vim -Provides: %{repo}-io-vim = %{version}-%{release} +Summary: Vim syntax highlighting files for Docker +Group: System/Kernel and hardware +Requires: %{name} = %{EVRD} +Requires: vim +Provides: %{name}-io-vim = %{EVRD} %description vim This package installs %{summary}. +%files vim +%doc README.md +%{_datadir}/vim/vimfiles/ftdetect/%{name}file.vim +%{_datadir}/vim/vimfiles/syntax/%{name}file.vim + +#------------------------------------------------------------------ + %package zsh-completion -Summary: Zsh completion files for Docker -Requires: %{repo} = %{version}-%{release} -Requires: zsh -Provides: %{repo}-io-zsh-completion = %{version}-%{release} +Summary: Zsh completion files for Docker +Group: System/Kernel and hardware +Requires: %{name} = %{EVRD} +Requires: zsh +Provides: %{name}-io-zsh-completion = %{EVRD} %description zsh-completion This package installs %{summary}. +%files zsh-completion +%doc README.md +%{_datadir}/zsh/site-functions/_%{name} + +#------------------------------------------------------------------ %prep -%setup -q -n moby-%{dist_version}-ce -%apply_patches - -tar -xf %{SOURCE3} -C vendor/github.com/ +%setup -q -n %{name}-ce-%{version} -a10 -a11 +mv libnetwork-master libnetwork +mv tini-* tini %build +# magic again +fake_gopath_pushd() { + mkdir -p "$(pwd)/src/${2%/*}" + rm -f "$(pwd)/src/$2" + ln -rsT "$1" "$(pwd)/src/$2" + pushd "$(pwd)/src/$2" >/dev/null +} + +fake_gopath_popd() { + popd >/dev/null +} + export DOCKER_GITCOMMIT="%{shortcommit}" +mkdir -p src/github.com/%{name} +export GOPATH=%{_libdir}/golang:$(pwd) +# MAGIC HERE +ln -s ../../../components/cli src/github.com/%{name} +ln -s ../../../components/engine src/github.com/%{name}/%{name} -export CGO_CFLAGS="-I%{_includedir}" -export CGO_LDFLAGS="-L%{_libdir}" +# dockerd +pushd components/engine + DOCKER_BUILDTAGS='seccomp journald' VERSION=%{version} hack/make.sh dynbinary +popd +# docker cli +pushd components/cli + DISABLE_WARN_OUTSIDE_CONTAINER=1 make VERSION=%{version} dynbinary +popd -AUTO_GOPATH=1 ./hack/make.sh dynbinary -man/md2man-all.sh -cp contrib/syntax/vim/LICENSE LICENSE-vim-syntax -cp contrib/syntax/vim/README.md README-vim-syntax.md +### docker proxy +fake_gopath_pushd libnetwork github.com/%{name}/libnetwork + go build -ldflags='-linkmode=external' github.com/%{name}/libnetwork/cmd/proxy +fake_gopath_popd -echo "build docker-proxy" -export GOPATH=$(pwd) -ln -s vendor src -go build -ldflags='-linkmode=external' github.com/libnetwork/cmd/proxy +### docker-init +fake_gopath_pushd tini github.com/krallin/tini + %cmake + %make tini-static +fake_gopath_popd %install -# install binary +# install binaries install -d %{buildroot}%{_bindir} -install -p -m 755 bundles/%{version}-ce/dynbinary-client/docker-%{version}-ce %{buildroot}%{_bindir}/docker -install -p -m 755 bundles/%{version}-ce/dynbinary-daemon/dockerd-%{version}-ce %{buildroot}%{_bindir}/dockerd -install -p -m 755 proxy %{buildroot}%{_bindir}/docker-proxy +install -p -m 755 components/cli/build/%{name}-linux-* %{buildroot}%{_bindir}/%{name} +install -d %{buildroot}%{_sbindir} +install -p -m 755 components/engine/bundles/dynbinary-daemon/%{name}d-%{version} %{buildroot}%{_sbindir}/%{name}d +install -p -m 755 libnetwork/proxy %{buildroot}%{_bindir}/%{name}-proxy +install -p -m 755 tini/build/tini-static %{buildroot}%{_bindir}/%{name}-init # Place to store images -install -d %{buildroot}%{_libexecdir}/cache/docker - -# install manpages -install -d %{buildroot}%{_mandir}/man1 -install -p -m 644 man/man1/*.1 %{buildroot}%{_mandir}/man1 -install -d %{buildroot}%{_mandir}/man5 -install -p -m 644 man/man5/*.5 %{buildroot}%{_mandir}/man5 -install -d %{buildroot}%{_mandir}/man8 -install -p -m 644 man/man8/*.8 %{buildroot}%{_mandir}/man8 +install -d %{buildroot}%{_var}/lib/%{name} # install bash completion install -d %{buildroot}%{_sysconfdir}/bash_completion.d -install -p -m 644 contrib/completion/bash/docker %{buildroot}%{_sysconfdir}/bash_completion.d/docker.bash +install -p -m 644 components/cli/contrib/completion/bash/%{name} %{buildroot}%{_sysconfdir}/bash_completion.d/%{name}.bash # install fish completion # create, install and own /usr/share/fish/vendor_completions.d until # upstream fish provides it install -dp %{buildroot}%{_datadir}/fish/vendor_completions.d -install -p -m 644 contrib/completion/fish/%{repo}.fish %{buildroot}%{_datadir}/fish/vendor_completions.d +install -p -m 644 components/cli/contrib/completion/fish/%{name}.fish %{buildroot}%{_datadir}/fish/vendor_completions.d # install vim syntax highlighting install -d %{buildroot}%{_datadir}/vim/vimfiles/{doc,ftdetect,syntax} -install -p -m 644 contrib/syntax/vim/doc/dockerfile.txt %{buildroot}%{_datadir}/vim/vimfiles/doc -install -p -m 644 contrib/syntax/vim/ftdetect/dockerfile.vim %{buildroot}%{_datadir}/vim/vimfiles/ftdetect -install -p -m 644 contrib/syntax/vim/syntax/dockerfile.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax +install -p -m 644 components/engine/contrib/syntax/vim/ftdetect/%{name}file.vim %{buildroot}%{_datadir}/vim/vimfiles/ftdetect +install -p -m 644 components/engine/contrib/syntax/vim/syntax/%{name}file.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax # install zsh completion install -d %{buildroot}%{_datadir}/zsh/site-functions -install -p -m 644 contrib/completion/zsh/_docker %{buildroot}%{_datadir}/zsh/site-functions +install -p -m 644 components/cli/contrib/completion/zsh/_%{name} %{buildroot}%{_datadir}/zsh/site-functions # install udev rules install -d %{buildroot}%{_udevrulesdir} -install -p -m 755 contrib/udev/80-docker.rules %{buildroot}%{_udevrulesdir} +install -p -m 644 components/engine/contrib/udev/80-%{name}.rules %{buildroot}%{_udevrulesdir} # install storage dir -install -d -m 700 %{buildroot}%{_sharedstatedir}/docker +install -d -m 700 %{buildroot}%{_var}/lib/%{name} # install systemd/init scripts install -d %{buildroot}%{_unitdir} -install -p -m 644 contrib/init/systemd/docker.service.rpm %{buildroot}%{_unitdir}/docker.service -install -p -m 644 contrib/init/systemd/docker.socket %{buildroot}%{_unitdir} +install -p -m 644 %{SOURCE1} %{SOURCE7} %{buildroot}%{_unitdir} -# sources -install -d -p %{buildroot}/%{gosrc} - -for dir in api daemon \ - image opts pkg registry runconfig -do - cp -rpav $dir %{buildroot}/%{gosrc} -done +# for additional args +install -d %{buildroot}%{_sysconfdir}/sysconfig/ +install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name} +install -p -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-network +install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-storage +#network cleanup +install -d %{buildroot}%{_sbindir} +install -p -m 755 %{SOURCE8} %{buildroot}%{_sbindir}/%{name}-network-cleanup install -d %{buildroot}%{_presetdir} -cat > %{buildroot}%{_presetdir}/86-docker.preset << EOF -enable docker.socket +cat > %{buildroot}%{_presetdir}/86-%{name}.preset << EOF +enable %{name}.socket EOF -find %{buildroot} -name "*~" -exec rm -rf {} \; -find %{buildroot}%{go_dir}/src/pkg/github.com/ -type d -exec chmod 0755 {} \; - -%check - -%pre -getent group docker > /dev/null || %{_sbindir}/groupadd -r docker -exit 0 - -%post -%systemd_post docker - -%preun -%systemd_preun docker - -%postun -%systemd_postun_with_restart docker - -%files -%doc AUTHORS CHANGELOG.md CONTRIBUTING.md LICENSE MAINTAINERS NOTICE README.md -%doc LICENSE-vim-syntax README-vim-syntax.md -# %config(noreplace) %{_sysconfdir}/sysconfig/%{repo} -# %config(noreplace) %{_sysconfdir}/sysconfig/%{repo}-network -# %config(noreplace) %{_sysconfdir}/sysconfig/%{repo}-storage -%{_mandir}/man1/*.1* -%{_mandir}/man5/*.5* -%{_mandir}/man8/*.8* -%{_bindir}/docker -%{_bindir}/docker-proxy -%{_bindir}/dockerd -# %config(noreplace) %{_sysconfdir}/sysconfig/docker -%{_presetdir}/86-docker.preset -%{_unitdir}/docker.service -%{_unitdir}/docker.socket -%dir %{_sysconfdir}/bash_completion.d -%{_sysconfdir}/bash_completion.d/docker.bash -# %{_datadir}/zsh/site-functions/_docker -%dir %{_sharedstatedir}/docker - -%dir %{_udevrulesdir} -%{_udevrulesdir}/80-docker.rules - -# %files unit-test -# %{_sharedstatedir}/docker-unit-test/ - -%files fish-completion -%dir %{_datadir}/fish/vendor_completions.d/ -%{_datadir}/fish/vendor_completions.d/%{repo}.fish - -# %files logrotate -# %doc README.%{repo}-logrotate -# %{_sysconfdir}/cron.daily/%{repo}-logrotate - -%files vim -%doc LICENSE-vim-syntax README-vim-syntax.md -%dir %{_datadir}/vim/vimfiles/doc -%{_datadir}/vim/vimfiles/doc/dockerfile.txt -%dir %{_datadir}/vim/vimfiles/ftdetect -%{_datadir}/vim/vimfiles/ftdetect/dockerfile.vim -%dir %{_datadir}/vim/vimfiles/syntax -%{_datadir}/vim/vimfiles/syntax/dockerfile.vim - -%files zsh-completion -%{_datadir}/zsh/site-functions/_%{repo} - -%files devel -%doc AUTHORS CHANGELOG.md CONTRIBUTING.md LICENSE MAINTAINERS NOTICE README.md -%dir %{go_dir}/src/pkg/%{provider}.%{provider_tld}/%{project} -%{go_dir}/src/pkg/%{import_path} +install -d %{buildroot}%{_sysconfdir}/modules-load.d/ +install -p -m 644 %{SOURCE9} %{buildroot}%{_sysconfdir}/modules-load.d/overlay.conf diff --git a/docker.sysconfig b/docker.sysconfig new file mode 100644 index 0000000..9813b64 --- /dev/null +++ b/docker.sysconfig @@ -0,0 +1,22 @@ +# /etc/sysconfig/docker + +# Modify these options if you want to change the way the docker daemon runs +OPTIONS='' +DOCKER_CERT_PATH=/etc/docker + +# Enable insecure registry communication by appending the registry URL +# to the INSECURE_REGISTRY variable below and uncommenting it +# INSECURE_REGISTRY='--insecure-registry ' + +# On SELinux System, if you remove the --selinux-enabled option, you +# also need to turn on the docker_transition_unconfined boolean. +# setsebool -P docker_transition_unconfined + +# Location used for temporary files, such as those created by +# docker load and build operations. Default is /var/lib/docker/tmp +# Can be overriden by setting the following environment variable. +# DOCKER_TMPDIR=/var/tmp + +# Controls the /etc/cron.daily/docker-logrotate cron job status. +# To disable, uncomment the line below. +# LOGROTATE=false diff --git a/overlay.conf b/overlay.conf new file mode 100644 index 0000000..08047cf --- /dev/null +++ b/overlay.conf @@ -0,0 +1 @@ +overlay