-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RPM packaging for 18.09.x #131
Changes from 1 commit
2a27fb1
111b5ba
ca519bb
5513629
c245ce1
481c395
f99ffa4
df2a0d6
558cd9c
2134ee5
86dafe5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Signed-off-by: Eli Uriegas <[email protected]>
- Loading branch information
There are no files selected for viewing
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" | ||
} |
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you provide more context to your comments? |
||
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 || : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is docker being stopped but the docker-is-active file is being touched? |
||
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 || : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the is active file being removed? |
||
fi | ||
fi | ||
|
||
%changelog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty cool