From bb66d7144f7d0a617f5985486ae36bbbaa5461ba Mon Sep 17 00:00:00 2001 From: Ken Cochrane Date: Mon, 21 Mar 2016 20:37:31 -0400 Subject: [PATCH] Packaging changes required for new containerd binaries These are the changes required due to the new binaries that containerd introduced. The rpm, and deb packages now include 5 binaries. docker, containerd, containerd-shim, ctr, and runc The tar files also include all 5 binaries. Signed-off-by: Ken Cochrane --- .../deb/amd64/debian-jessie/Dockerfile | 3 ++- .../deb/amd64/debian-stretch/Dockerfile | 3 ++- .../deb/amd64/debian-wheezy/Dockerfile | 3 ++- contrib/builder/deb/amd64/generate.sh | 6 ++++- .../deb/amd64/ubuntu-precise/Dockerfile | 3 ++- .../deb/amd64/ubuntu-trusty/Dockerfile | 3 ++- .../builder/deb/amd64/ubuntu-wily/Dockerfile | 3 ++- .../deb/amd64/ubuntu-xenial/Dockerfile | 16 ++++++++++++ contrib/builder/rpm/amd64/centos-7/Dockerfile | 5 ++-- .../builder/rpm/amd64/fedora-22/Dockerfile | 5 ++-- .../builder/rpm/amd64/fedora-23/Dockerfile | 5 ++-- contrib/builder/rpm/amd64/generate.sh | 5 ++++ .../rpm/amd64/opensuse-13.2/Dockerfile | 5 ++-- .../rpm/amd64/oraclelinux-6/Dockerfile | 5 ++-- .../rpm/amd64/oraclelinux-7/Dockerfile | 5 ++-- hack/make/.build-deb/rules | 7 ++++++ hack/make/.build-rpm/docker-engine.spec | 12 +++++++++ hack/make/build-deb | 21 +++++++++++++++- hack/make/build-rpm | 25 ++++++++++++++++++- hack/make/tgz | 2 -- 20 files changed, 119 insertions(+), 23 deletions(-) create mode 100644 contrib/builder/deb/amd64/ubuntu-xenial/Dockerfile diff --git a/contrib/builder/deb/amd64/debian-jessie/Dockerfile b/contrib/builder/deb/amd64/debian-jessie/Dockerfile index 6cb64b3fec..77a3ada49b 100644 --- a/contrib/builder/deb/amd64/debian-jessie/Dockerfile +++ b/contrib/builder/deb/amd64/debian-jessie/Dockerfile @@ -6,10 +6,11 @@ FROM debian:jessie RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev pkg-config libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 ENV DOCKER_BUILDTAGS apparmor selinux +ENV RUNC_BUILDTAGS apparmor selinux diff --git a/contrib/builder/deb/amd64/debian-stretch/Dockerfile b/contrib/builder/deb/amd64/debian-stretch/Dockerfile index 543cebb006..289afe3e24 100644 --- a/contrib/builder/deb/amd64/debian-stretch/Dockerfile +++ b/contrib/builder/deb/amd64/debian-stretch/Dockerfile @@ -6,10 +6,11 @@ FROM debian:stretch RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libseccomp-dev libsqlite3-dev pkg-config libsystemd-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 ENV DOCKER_BUILDTAGS apparmor seccomp selinux +ENV RUNC_BUILDTAGS apparmor seccomp selinux diff --git a/contrib/builder/deb/amd64/debian-wheezy/Dockerfile b/contrib/builder/deb/amd64/debian-wheezy/Dockerfile index bc1028a0f1..6647c6b5bd 100644 --- a/contrib/builder/deb/amd64/debian-wheezy/Dockerfile +++ b/contrib/builder/deb/amd64/debian-wheezy/Dockerfile @@ -7,10 +7,11 @@ FROM debian:wheezy-backports RUN apt-get update && apt-get install -y -t wheezy-backports btrfs-tools --no-install-recommends && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -y apparmor bash-completion build-essential curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev pkg-config --no-install-recommends && rm -rf /var/lib/apt/lists/* -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 ENV DOCKER_BUILDTAGS apparmor selinux +ENV RUNC_BUILDTAGS apparmor selinux diff --git a/contrib/builder/deb/amd64/generate.sh b/contrib/builder/deb/amd64/generate.sh index 9974aef345..86dfab0d2c 100755 --- a/contrib/builder/deb/amd64/generate.sh +++ b/contrib/builder/deb/amd64/generate.sh @@ -42,6 +42,7 @@ for version in "${versions[@]}"; do echo >> "$version/Dockerfile" extraBuildTags= + runcBuildTags= # this list is sorted alphabetically; please keep it that way packages=( @@ -64,7 +65,7 @@ for version in "${versions[@]}"; do # packaging for "sd-journal.h" and libraries varies case "$suite" in precise|wheezy) ;; - sid|stretch|wily) packages+=( libsystemd-dev );; + sid|stretch|wily|xenial) packages+=( libsystemd-dev );; *) packages+=( libsystemd-journal-dev );; esac @@ -73,9 +74,11 @@ for version in "${versions[@]}"; do case "$suite" in precise|wheezy|jessie|trusty) packages=( "${packages[@]/libseccomp-dev}" ) + runcBuildTags="apparmor selinux" ;; *) extraBuildTags+=' seccomp' + runcBuildTags="apparmor seccomp selinux" ;; esac @@ -124,4 +127,5 @@ for version in "${versions[@]}"; do buildTags=$( echo "apparmor selinux $extraBuildTags" | xargs -n1 | sort -n | tr '\n' ' ' | sed -e 's/[[:space:]]*$//' ) echo "ENV DOCKER_BUILDTAGS $buildTags" >> "$version/Dockerfile" + echo "ENV RUNC_BUILDTAGS $runcBuildTags" >> "$version/Dockerfile" done diff --git a/contrib/builder/deb/amd64/ubuntu-precise/Dockerfile b/contrib/builder/deb/amd64/ubuntu-precise/Dockerfile index f6c4f27b58..3b44082956 100644 --- a/contrib/builder/deb/amd64/ubuntu-precise/Dockerfile +++ b/contrib/builder/deb/amd64/ubuntu-precise/Dockerfile @@ -6,10 +6,11 @@ FROM ubuntu:precise RUN apt-get update && apt-get install -y apparmor bash-completion build-essential curl ca-certificates debhelper dh-apparmor git libapparmor-dev libltdl-dev libsqlite3-dev pkg-config --no-install-recommends && rm -rf /var/lib/apt/lists/* -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 ENV DOCKER_BUILDTAGS apparmor exclude_graphdriver_btrfs exclude_graphdriver_devicemapper selinux +ENV RUNC_BUILDTAGS apparmor selinux diff --git a/contrib/builder/deb/amd64/ubuntu-trusty/Dockerfile b/contrib/builder/deb/amd64/ubuntu-trusty/Dockerfile index 0d8472d112..e8344a1243 100644 --- a/contrib/builder/deb/amd64/ubuntu-trusty/Dockerfile +++ b/contrib/builder/deb/amd64/ubuntu-trusty/Dockerfile @@ -6,10 +6,11 @@ FROM ubuntu:trusty RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev pkg-config libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 ENV DOCKER_BUILDTAGS apparmor selinux +ENV RUNC_BUILDTAGS apparmor selinux diff --git a/contrib/builder/deb/amd64/ubuntu-wily/Dockerfile b/contrib/builder/deb/amd64/ubuntu-wily/Dockerfile index 4e0beedd8b..dec74cf624 100644 --- a/contrib/builder/deb/amd64/ubuntu-wily/Dockerfile +++ b/contrib/builder/deb/amd64/ubuntu-wily/Dockerfile @@ -6,10 +6,11 @@ FROM ubuntu:wily RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libseccomp-dev libsqlite3-dev pkg-config libsystemd-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 ENV DOCKER_BUILDTAGS apparmor seccomp selinux +ENV RUNC_BUILDTAGS apparmor seccomp selinux diff --git a/contrib/builder/deb/amd64/ubuntu-xenial/Dockerfile b/contrib/builder/deb/amd64/ubuntu-xenial/Dockerfile new file mode 100644 index 0000000000..5cf2d4312b --- /dev/null +++ b/contrib/builder/deb/amd64/ubuntu-xenial/Dockerfile @@ -0,0 +1,16 @@ +# +# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/amd64/generate.sh"! +# + +FROM ubuntu:xenial + +RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libseccomp-dev libsqlite3-dev pkg-config libsystemd-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* + +ENV GO_VERSION 1.6 +RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local +ENV PATH $PATH:/usr/local/go/bin + +ENV AUTO_GOPATH 1 + +ENV DOCKER_BUILDTAGS apparmor seccomp selinux +ENV RUNC_BUILDTAGS apparmor seccomp selinux diff --git a/contrib/builder/rpm/amd64/centos-7/Dockerfile b/contrib/builder/rpm/amd64/centos-7/Dockerfile index 06750eeb85..56ed191cba 100644 --- a/contrib/builder/rpm/amd64/centos-7/Dockerfile +++ b/contrib/builder/rpm/amd64/centos-7/Dockerfile @@ -6,13 +6,14 @@ FROM centos:7 RUN yum groupinstall -y "Development Tools" RUN yum -y swap -- remove systemd-container systemd-container-libs -- install systemd systemd-libs -RUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel sqlite-devel systemd-devel tar +RUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel sqlite-devel systemd-devel tar git -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 ENV DOCKER_BUILDTAGS selinux +ENV RUNC_BUILDTAGS selinux diff --git a/contrib/builder/rpm/amd64/fedora-22/Dockerfile b/contrib/builder/rpm/amd64/fedora-22/Dockerfile index f287dd0907..589a77de8a 100644 --- a/contrib/builder/rpm/amd64/fedora-22/Dockerfile +++ b/contrib/builder/rpm/amd64/fedora-22/Dockerfile @@ -5,13 +5,14 @@ FROM fedora:22 RUN dnf install -y @development-tools fedora-packager -RUN dnf install -y btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel sqlite-devel systemd-devel tar +RUN dnf install -y btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel sqlite-devel systemd-devel tar git -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 ENV DOCKER_BUILDTAGS seccomp selinux +ENV RUNC_BUILDTAGS seccomp selinux diff --git a/contrib/builder/rpm/amd64/fedora-23/Dockerfile b/contrib/builder/rpm/amd64/fedora-23/Dockerfile index ba75402e62..fcd0e8f5b8 100644 --- a/contrib/builder/rpm/amd64/fedora-23/Dockerfile +++ b/contrib/builder/rpm/amd64/fedora-23/Dockerfile @@ -5,13 +5,14 @@ FROM fedora:23 RUN dnf install -y @development-tools fedora-packager -RUN dnf install -y btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel sqlite-devel systemd-devel tar +RUN dnf install -y btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel sqlite-devel systemd-devel tar git -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 ENV DOCKER_BUILDTAGS seccomp selinux +ENV RUNC_BUILDTAGS seccomp selinux diff --git a/contrib/builder/rpm/amd64/generate.sh b/contrib/builder/rpm/amd64/generate.sh index 847c8203c8..05a7797c0d 100755 --- a/contrib/builder/rpm/amd64/generate.sh +++ b/contrib/builder/rpm/amd64/generate.sh @@ -39,6 +39,7 @@ for version in "${versions[@]}"; do echo >> "$version/Dockerfile" extraBuildTags= + runcBuildTags= case "$from" in centos:*) @@ -77,6 +78,7 @@ for version in "${versions[@]}"; do sqlite-devel # for "sqlite3.h" systemd-devel # for "sd-journal.h" and libraries tar # older versions of dev-tools do not have tar + git # required for containerd and runc clone ) case "$from" in @@ -98,9 +100,11 @@ for version in "${versions[@]}"; do case "$from" in opensuse:*|oraclelinux:*|centos:7) packages=( "${packages[@]/libseccomp-devel}" ) + runcBuildTags="selinux" ;; *) extraBuildTags+=' seccomp' + runcBuildTags="seccomp selinux" ;; esac @@ -148,6 +152,7 @@ for version in "${versions[@]}"; do buildTags=$( echo "selinux $extraBuildTags" | xargs -n1 | sort -n | tr '\n' ' ' | sed -e 's/[[:space:]]*$//' ) echo "ENV DOCKER_BUILDTAGS $buildTags" >> "$version/Dockerfile" + echo "ENV RUNC_BUILDTAGS $runcBuildTags" >> "$version/Dockerfile" echo >> "$version/Dockerfile" case "$from" in diff --git a/contrib/builder/rpm/amd64/opensuse-13.2/Dockerfile b/contrib/builder/rpm/amd64/opensuse-13.2/Dockerfile index 84b4a2b608..6fbe63070f 100644 --- a/contrib/builder/rpm/amd64/opensuse-13.2/Dockerfile +++ b/contrib/builder/rpm/amd64/opensuse-13.2/Dockerfile @@ -5,13 +5,14 @@ FROM opensuse:13.2 RUN zypper --non-interactive install ca-certificates* curl gzip rpm-build -RUN zypper --non-interactive install libbtrfs-devel device-mapper-devel glibc-static libselinux-devel libtool-ltdl-devel pkg-config selinux-policy selinux-policy-devel sqlite-devel systemd-devel tar systemd-rpm-macros +RUN zypper --non-interactive install libbtrfs-devel device-mapper-devel glibc-static libselinux-devel libtool-ltdl-devel pkg-config selinux-policy selinux-policy-devel sqlite-devel systemd-devel tar git systemd-rpm-macros -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 ENV DOCKER_BUILDTAGS selinux +ENV RUNC_BUILDTAGS selinux diff --git a/contrib/builder/rpm/amd64/oraclelinux-6/Dockerfile b/contrib/builder/rpm/amd64/oraclelinux-6/Dockerfile index 13468e74fb..6f074dae28 100644 --- a/contrib/builder/rpm/amd64/oraclelinux-6/Dockerfile +++ b/contrib/builder/rpm/amd64/oraclelinux-6/Dockerfile @@ -5,18 +5,19 @@ FROM oraclelinux:6 RUN yum groupinstall -y "Development Tools" -RUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel sqlite-devel tar +RUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel sqlite-devel tar git RUN yum install -y yum-utils && curl -o /etc/yum.repos.d/public-yum-ol6.repo http://yum.oracle.com/public-yum-ol6.repo && yum-config-manager -q --enable ol6_UEKR4 RUN yum install -y kernel-uek-devel-4.1.12-32.el6uek -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 ENV DOCKER_BUILDTAGS selinux +ENV RUNC_BUILDTAGS selinux ENV CGO_CPPFLAGS -D__EXPORTED_HEADERS__ \ -I/usr/src/kernels/4.1.12-32.el6uek.x86_64/arch/x86/include/generated/uapi \ diff --git a/contrib/builder/rpm/amd64/oraclelinux-7/Dockerfile b/contrib/builder/rpm/amd64/oraclelinux-7/Dockerfile index dc8570a97c..e7465a6dbe 100644 --- a/contrib/builder/rpm/amd64/oraclelinux-7/Dockerfile +++ b/contrib/builder/rpm/amd64/oraclelinux-7/Dockerfile @@ -5,13 +5,14 @@ FROM oraclelinux:7 RUN yum groupinstall -y "Development Tools" -RUN yum install -y --enablerepo=ol7_optional_latest btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel sqlite-devel systemd-devel tar +RUN yum install -y --enablerepo=ol7_optional_latest btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel sqlite-devel systemd-devel tar git -ENV GO_VERSION 1.5.3 +ENV GO_VERSION 1.6 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 ENV DOCKER_BUILDTAGS selinux +ENV RUNC_BUILDTAGS selinux diff --git a/hack/make/.build-deb/rules b/hack/make/.build-deb/rules index 12a92edcb7..4436330282 100755 --- a/hack/make/.build-deb/rules +++ b/hack/make/.build-deb/rules @@ -22,6 +22,10 @@ override_dh_strip: override_dh_auto_install: mkdir -p debian/docker-engine/usr/bin cp -aT "$$(readlink -f bundles/$(VERSION)/dynbinary/docker)" debian/docker-engine/usr/bin/docker + cp -aT /usr/local/bin/containerd debian/docker-engine/usr/bin/docker-containerd + cp -aT /usr/local/bin/containerd-shim debian/docker-engine/usr/bin/docker-containerd-shim + cp -aT /usr/local/bin/ctr debian/docker-engine/usr/bin/docker-containerd-ctr + cp -aT /usr/local/bin/runc debian/docker-engine/usr/bin/docker-runc mkdir -p debian/docker-engine/usr/lib/docker override_dh_installinit: @@ -36,5 +40,8 @@ override_dh_install: dh_install dh_apparmor --profile-name=docker-engine -pdocker-engine +override_dh_shlibdeps: + dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info + %: dh $@ --with=bash-completion $(shell command -v dh_systemd_enable > /dev/null 2>&1 && echo --with=systemd) diff --git a/hack/make/.build-rpm/docker-engine.spec b/hack/make/.build-rpm/docker-engine.spec index a0b5eb0b24..d1fd934313 100644 --- a/hack/make/.build-rpm/docker-engine.spec +++ b/hack/make/.build-rpm/docker-engine.spec @@ -124,6 +124,14 @@ export DOCKER_GITCOMMIT=%{_gitcommit} install -d $RPM_BUILD_ROOT/%{_bindir} install -p -m 755 bundles/%{_origversion}/dynbinary/docker-%{_origversion} $RPM_BUILD_ROOT/%{_bindir}/docker +# install containerd +install -p -m 755 /usr/local/bin/containerd $RPM_BUILD_ROOT/%{_bindir}/docker-containerd +install -p -m 755 /usr/local/bin/containerd-shim $RPM_BUILD_ROOT/%{_bindir}/docker-containerd-shim +install -p -m 755 /usr/local/bin/ctr $RPM_BUILD_ROOT/%{_bindir}/docker-containerd-ctr + +# install runc +install -p -m 755 /usr/local/bin/runc $RPM_BUILD_ROOT/%{_bindir}/docker-runc + # install udev rules install -d $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d install -p -m 644 contrib/udev/80-docker.rules $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d/80-docker.rules @@ -171,6 +179,10 @@ install -p -m 644 contrib/syntax/nano/Dockerfile.nanorc $RPM_BUILD_ROOT/usr/shar %files %doc AUTHORS CHANGELOG.md CONTRIBUTING.md LICENSE MAINTAINERS NOTICE README.md /%{_bindir}/docker +/%{_bindir}/docker-containerd +/%{_bindir}/docker-containerd-shim +/%{_bindir}/docker-containerd-ctr +/%{_bindir}/docker-runc /%{_sysconfdir}/udev/rules.d/80-docker.rules %if 0%{?is_systemd} /%{_unitdir}/docker.service diff --git a/hack/make/build-deb b/hack/make/build-deb index 64cd527a6b..b260213999 100644 --- a/hack/make/build-deb +++ b/hack/make/build-deb @@ -58,9 +58,28 @@ set -e FROM $image WORKDIR /usr/src/docker COPY . /usr/src/docker - RUN mkdir -p /go/src/github.com/docker \ + RUN mkdir -p /go/src/github.com/docker && mkdir -p /go/src/github.com/opencontainers \ && ln -snf /usr/src/docker /go/src/github.com/docker/docker EOF + + # get the RUNC and CONTAINERD commit from the root Dockerfile, this keeps the commits in sync + awk '$1 == "ENV" && $2 == "RUNC_COMMIT" { print; exit }' Dockerfile >> "$DEST/$version/Dockerfile.build" + awk '$1 == "ENV" && $2 == "CONTAINERD_COMMIT" { print; exit }' Dockerfile >> "$DEST/$version/Dockerfile.build" + + # add runc and containerd compile and install + cat >> "$DEST/$version/Dockerfile.build" <<-EOF + # Install runc + RUN git clone git://github.com/opencontainers/runc.git "/go/src/github.com/opencontainers/runc" \ + && cd "/go/src/github.com/opencontainers/runc" \ + && git checkout -q "\$RUNC_COMMIT" + RUN set -x && export GOPATH="/go" && cd "/go/src/github.com/opencontainers/runc" \ + && make BUILDTAGS="\$RUNC_BUILDTAGS" && make install + # Install containerd + RUN git clone git://github.com/docker/containerd.git "/go/src/github.com/docker/containerd" \ + && cd "/go/src/github.com/docker/containerd" \ + && git checkout -q "\$CONTAINERD_COMMIT" + RUN set -x && export GOPATH="/go" && cd "/go/src/github.com/docker/containerd" && make && make install + EOF if [ "$DOCKER_EXPERIMENTAL" ]; then echo 'ENV DOCKER_EXPERIMENTAL 1' >> "$DEST/$version/Dockerfile.build" fi diff --git a/hack/make/build-rpm b/hack/make/build-rpm index 449071fdb4..f0e496bbb8 100644 --- a/hack/make/build-rpm +++ b/hack/make/build-rpm @@ -87,6 +87,26 @@ set -e cat > "$DEST/$version/Dockerfile.build" <<-EOF FROM $image COPY . /usr/src/${rpmName} + RUN mkdir -p /go/src/github.com/docker && mkdir -p /go/src/github.com/opencontainers + EOF + + # get the RUNC and CONTAINERD commit from the root Dockerfile, this keeps the commits in sync + awk '$1 == "ENV" && $2 == "RUNC_COMMIT" { print; exit }' Dockerfile >> "$DEST/$version/Dockerfile.build" + awk '$1 == "ENV" && $2 == "CONTAINERD_COMMIT" { print; exit }' Dockerfile >> "$DEST/$version/Dockerfile.build" + + # add runc and containerd compile and install + cat >> "$DEST/$version/Dockerfile.build" <<-EOF + # Install runc + RUN git clone git://github.com/opencontainers/runc.git "/go/src/github.com/opencontainers/runc" \ + && cd "/go/src/github.com/opencontainers/runc" \ + && git checkout -q "\$RUNC_COMMIT" + RUN set -x && export GOPATH="/go" && cd "/go/src/github.com/opencontainers/runc" \ + && make BUILDTAGS="\$RUNC_BUILDTAGS" && make install + # Install containerd + RUN git clone git://github.com/docker/containerd.git "/go/src/github.com/docker/containerd" \ + && cd "/go/src/github.com/docker/containerd" \ + && git checkout -q "\$CONTAINERD_COMMIT" + RUN set -x && export GOPATH="/go" && cd "/go/src/github.com/docker/containerd" && make && make install EOF if [ "$DOCKER_EXPERIMENTAL" ]; then echo 'ENV DOCKER_EXPERIMENTAL 1' >> "$DEST/$version/Dockerfile.build" @@ -97,7 +117,10 @@ set -e WORKDIR /root/rpmbuild RUN ln -sfv /usr/src/${rpmName}/hack/make/.build-rpm SPECS WORKDIR /root/rpmbuild/SPECS - RUN tar -cz -C /usr/src -f /root/rpmbuild/SOURCES/${rpmName}.tar.gz ${rpmName} + RUN tar -r -C /usr/src -f /root/rpmbuild/SOURCES/${rpmName}.tar ${rpmName} + RUN tar -r -C /go/src/github.com/docker -f /root/rpmbuild/SOURCES/${rpmName}.tar containerd + RUN tar -r -C /go/src/github.com/opencontainers -f /root/rpmbuild/SOURCES/${rpmName}.tar runc + RUN gzip /root/rpmbuild/SOURCES/${rpmName}.tar RUN { cat /usr/src/${rpmName}/contrib/builder/rpm/${PACKAGE_ARCH}/changelog; } >> ${rpmName}.spec && tail >&2 ${rpmName}.spec RUN rpmbuild -ba \ --define '_gitcommit $DOCKER_GITCOMMIT' \ diff --git a/hack/make/tgz b/hack/make/tgz index 93a69cbe53..68ef207390 100644 --- a/hack/make/tgz +++ b/hack/make/tgz @@ -19,8 +19,6 @@ for d in "$CROSS/"*/*; do mkdir -p "$DEST/$GOOS/$GOARCH" TGZ="$DEST/$GOOS/$GOARCH/$BINARY_NAME.tgz" - mkdir -p "$DEST/build" - mkdir -p "$DEST/build/usr/local/bin" cp -L "$d/$BINARY_FULLNAME" "$DEST/build/usr/local/bin/docker$BINARY_EXTENSION" copy_containerd "$DEST/build/usr/local/bin/"