-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add systemd files, add containerd-proxy config
Signed-off-by: Eli Uriegas <[email protected]>
- Loading branch information
1 parent
c245ce1
commit 481c395
Showing
5 changed files
with
77 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"image": "${ENGINE_IMAGE}", | ||
"namespace":"docker", | ||
"args": [ | ||
"-s", "overlay", | ||
"--containerd", "/run/containerd/containerd.sock", | ||
"--default-runtime", "containerd", | ||
"--add-runtime", "containerd=runc" | ||
], | ||
"scope": "ce" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ Release: %{_release}%{?dist} | |
Epoch: 2 | ||
Source0: containerd-proxy.tgz | ||
Source1: containerd-shim-process.tar | ||
Source2: docker.service | ||
Summary: The open-source application container engine | ||
Group: Tools/Docker | ||
License: ASL 2.0 | ||
|
@@ -14,10 +15,15 @@ Vendor: Docker | |
Packager: Docker <[email protected]> | ||
|
||
Requires: docker-ce-cli | ||
Requires: systemd-units | ||
Requires: iptables | ||
# Should be required as well by docker-ce-cli but let's just be thorough | ||
Requires: containerd.io | ||
|
||
BuildRequires: which | ||
BuildRequires: make | ||
BuildRequires: gcc | ||
BuildRequires: pkgconfig(systemd) | ||
|
||
# conflicting packages | ||
Conflicts: docker | ||
|
@@ -49,20 +55,58 @@ depending on a particular stack or provider. | |
mkdir -p /go/src/github.com/crosbymichael/ | ||
ls %{_topdir}/BUILD/src | ||
ln -s %{_topdir}/BUILD/src/containerd-proxy /go/src/github.com/crosbymichael/containerd-proxy | ||
go build -v -o /build/dockerd github.com/crosbymichael/containerd-proxy | ||
pushd /go/src/github.com/crosbymichael/containerd-proxy | ||
make SCOPE_LABEL="com.docker/containerd-proxy.scope" ANY_SCOPE="ee" bin/containerd-proxy | ||
popd | ||
|
||
%install | ||
install -D -m 0755 /build/dockerd $RPM_BUILD_ROOT/%{_bindir}/dockerd | ||
# TODO: Use containerd-offline-installer to actually install this as ExecStartPre systemd step | ||
# Install containerd-proxy as dockerd | ||
install -D -m 0755 %{_topdir}/BUILD/src/containerd-proxy/bin/containerd-proxy $RPM_BUILD_ROOT/%{_bindir}/dockerd | ||
install -D -m 0644 %{_topdir}/SOURCES/containerd-shim-process.tar $RPM_BUILD_ROOT/%{_sharedstatedir}/containerd/containerd-shim-process.tar | ||
install -D -m 0644 %{_topdir}/SOURCES/docker.service $RPM_BUILD_ROOT/%{_unitdir}/docker.service | ||
install -D -m 0644 %{_topdir}/SOURCES/dockerd.json $RPM_BUILD_ROOT/etc/containerd-proxy/dockerd.json | ||
|
||
%files | ||
/%{_bindir}/dockerd | ||
/%{_sharedstatedir}/containerd/containerd-shim-process.tar | ||
/%{_unitdir}/docker.service | ||
/etc/containerd-proxy/dockerd.json | ||
|
||
%pre | ||
if [ $1 -gt 0 ] ; then | ||
# package upgrade scenario, before new files are installed | ||
|
||
# clear any old state | ||
rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : | ||
|
||
# check if docker service is running | ||
if systemctl is-active docker > /dev/null 2>&1; then | ||
systemctl stop docker > /dev/null 2>&1 || : | ||
touch %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : | ||
fi | ||
fi | ||
|
||
%post | ||
%systemd_post docker | ||
if ! getent group docker > /dev/null; then | ||
groupadd --system docker | ||
fi | ||
|
||
%preun | ||
%systemd_preun docker | ||
|
||
%postun | ||
%systemd_postun_with_restart docker | ||
|
||
%posttrans | ||
if [ $1 -ge 0 ] ; then | ||
# package upgrade scenario, after new files are installed | ||
|
||
# check if docker was running before upgrade | ||
if [ -f %{_localstatedir}/lib/rpm-state/docker-is-active ]; then | ||
systemctl start docker > /dev/null 2>&1 || : | ||
rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : | ||
fi | ||
fi | ||
|
||
%changelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters