diff --git a/Jenkinsfile b/Jenkinsfile index 4d5f7eeeb6..d9e0d43bf9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ test_steps = [ checkout scm sh('git clone https://github.com/docker/cli.git') sh("git -C cli checkout $branch") - sh('git clone https://github.com/docker/engine.git') + sh('git clone https://github.com/docker/docker.git engine') sh("git -C engine checkout $branch") sh('make -C deb VERSION=0.0.1-dev ENGINE_DIR=$(pwd)/engine CLI_DIR=$(pwd)/cli ubuntu-xenial ubuntu-focal') } finally { @@ -26,7 +26,7 @@ test_steps = [ checkout scm sh('git clone https://github.com/docker/cli.git') sh("git -C cli checkout $branch") - sh('git clone https://github.com/docker/engine.git') + sh('git clone https://github.com/docker/docker.git engine') sh("git -C engine checkout $branch") sh('make -C rpm VERSION=0.0.1-dev ENGINE_DIR=$(pwd)/engine CLI_DIR=$(pwd)/cli centos-7') } finally { @@ -42,7 +42,7 @@ test_steps = [ checkout scm sh('git clone https://github.com/docker/cli.git') sh("git -C cli checkout $branch") - sh('git clone https://github.com/docker/engine.git') + sh('git clone https://github.com/docker/docker.git engine') sh("git -C engine checkout $branch") sh('make VERSION=0.0.1-dev DOCKER_BUILD_PKGS=static-linux ENGINE_DIR=$(pwd)/engine CLI_DIR=$(pwd)/cli static') } finally { diff --git a/README.md b/README.md index 9ec99e960d..a4dcab7b28 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,12 @@ The scripts will build for this list of packages types: * DEB packages for Ubuntu 20.04 Focal * DEB packages for Ubuntu 19.10 Eoan * DEB packages for Ubuntu 19.04 Disco -* DEB packages for Ubuntu 18.10 Cosmic * DEB packages for Ubuntu 18.04 Bionic * DEB packages for Ubuntu 16.04 Xenial * DEB packages for Debian 10 Buster * DEB packages for Debian 9 Stretch +* RPM packages for Fedora 32 * RPM packages for Fedora 31 * RPM packages for Fedora 30 -* RPM packages for Fedora 29 -* RPM packages for Fedora 28 * RPM packages for CentOS 7 * TGZ and ZIP files with static binaries diff --git a/deb/Makefile b/deb/Makefile index cb1b23c6c9..b4ee00ab46 100644 --- a/deb/Makefile +++ b/deb/Makefile @@ -35,11 +35,8 @@ RUN=docker run --rm -i \ $(RUN_FLAGS) \ debbuild-$@/$(ARCH) -SOURCE_FILES=cli.tgz engine.tgz docker.service docker.socket plugin-installers.tgz -SOURCES=$(addprefix sources/, $(SOURCE_FILES)) - DEBIAN_VERSIONS := debian-stretch debian-buster -UBUNTU_VERSIONS := ubuntu-xenial ubuntu-bionic ubuntu-cosmic ubuntu-disco ubuntu-eoan ubuntu-focal +UBUNTU_VERSIONS := ubuntu-xenial ubuntu-bionic ubuntu-disco ubuntu-eoan ubuntu-focal RASPBIAN_VERSIONS := raspbian-stretch raspbian-buster DISTROS := $(DEBIAN_VERSIONS) $(UBUNTU_VERSIONS) $(RASPBIAN_VERSIONS) @@ -67,7 +64,7 @@ debian: $(DEBIAN_VERSIONS) ## build all debian deb packages raspbian: $(RASPBIAN_VERSIONS) ## build all raspbian deb packages .PHONY: $(DISTROS) -$(DISTROS): $(SOURCES) +$(DISTROS): sources/cli.tgz sources/engine.tgz sources/docker.service sources/docker.socket sources/plugin-installers.tgz @echo "== Building packages for $@ ==" $(BUILD) $(RUN) diff --git a/deb/ubuntu-cosmic/Dockerfile b/deb/ubuntu-cosmic/Dockerfile deleted file mode 100644 index 73359b55da..0000000000 --- a/deb/ubuntu-cosmic/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -ARG GO_IMAGE -ARG DISTRO=ubuntu -ARG SUITE=cosmic -ARG BUILD_IMAGE=${DISTRO}:${SUITE} - -FROM ${GO_IMAGE} AS golang - -FROM ${BUILD_IMAGE} - -# Remove diverted man binary to prevent man-pages being replaced with "minimized" message. See docker/for-linux#639 -RUN if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then \ - rm -f /usr/bin/man; \ - dpkg-divert --quiet --remove --rename /usr/bin/man; \ - fi - -RUN apt-get update && apt-get install -y curl devscripts equivs git - -ENV GOPROXY=direct -ENV GO111MODULE=off -ENV GOPATH /go -ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin -ENV DOCKER_BUILDTAGS apparmor seccomp selinux -ENV RUNC_BUILDTAGS apparmor seccomp selinux - -ARG COMMON_FILES -COPY ${COMMON_FILES} /root/build-deb/debian -RUN mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/build-deb/debian/control - -COPY sources/ /sources -ARG DISTRO -ARG SUITE -ENV DISTRO=${DISTRO} -ENV SUITE=${SUITE} - -COPY --from=golang /usr/local/go /usr/local/go - -WORKDIR /root/build-deb -COPY build-deb /root/build-deb/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/rpm/Makefile b/rpm/Makefile index 25731aa0f7..ce881ba514 100644 --- a/rpm/Makefile +++ b/rpm/Makefile @@ -10,10 +10,6 @@ GO_IMAGE?=$(GO_BASE_IMAGE):$(GO_VERSION)-buster GEN_RPM_VER=$(shell ./gen-rpm-ver $(CLI_DIR) $(VERSION)) CHOWN=docker run --rm -i -v $(CURDIR):/v -w /v alpine chown -DOCKERFILE=Dockerfile -ifdef NEEDS_ARCH_SPECIFIC - DOCKERFILE=Dockerfile.$(ARCH) -endif ifdef BUILD_IMAGE BUILD_IMAGE_FLAG=--build-arg $(BUILD_IMAGE) endif @@ -22,7 +18,7 @@ BUILD?=DOCKER_BUILDKIT=1 \ $(BUILD_IMAGE_FLAG) \ --build-arg GO_IMAGE=$(GO_IMAGE) \ -t rpmbuild-$@/$(ARCH) \ - -f $@/$(DOCKERFILE) \ + -f $@/Dockerfile \ . SPEC_FILES?=docker-ce.spec docker-ce-cli.spec @@ -37,14 +33,17 @@ RPMBUILD_FLAGS?=-ba\ --define '_release $(word 2,$(GEN_RPM_VER))' \ --define '_version $(word 1,$(GEN_RPM_VER))' \ --define '_origversion $(word 4, $(GEN_RPM_VER))' \ + $(RPMBUILD_EXTRA_FLAGS) \ $(SPECS) RUN?=$(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS) SOURCE_FILES=engine.tgz cli.tgz docker.service docker.socket plugin-installers.tgz SOURCES=$(addprefix rpmbuild/SOURCES/, $(SOURCE_FILES)) -FEDORA_RELEASES := fedora-31 fedora-30 fedora-29 fedora-28 -CENTOS_RELEASES := centos-7 +FEDORA_RELEASES := fedora-32 fedora-31 fedora-30 +CENTOS_RELEASES := centos-7 centos-8 +RHEL_RELEASES := rhel-7 +DISTROS := $(FEDORA_RELEASES) $(CENTOS_RELEASES) $(RHEL_RELEASES) .PHONY: help help: ## show make targets @@ -61,11 +60,17 @@ rpm: fedora centos ## build all rpm packages .PHONY: fedora fedora: $(FEDORA_RELEASES) ## build all fedora rpm packages +.PHONY: centos-8 +centos-8: RPMBUILD_EXTRA_FLAGS=--define '_without_btrfs 1' + .PHONY: centos centos: $(CENTOS_RELEASES) ## build all centos rpm packages -.PHONY: $(FEDORA_RELEASES) $(CENTOS_RELEASES) -$(FEDORA_RELEASES) $(CENTOS_RELEASES): $(SOURCES) +.PHONY: rhel +rhel: $(RHEL_RELEASES) ## build all rhel rpm packages + +.PHONY: $(DISTROS) +$(DISTROS): rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz rpmbuild/SOURCES/docker.service rpmbuild/SOURCES/docker.socket rpmbuild/SOURCES/plugin-installers.tgz @echo "== Building packages for $@ ==" $(CHOWN) -R root:root rpmbuild $(BUILD) diff --git a/rpm/SPECS/docker-ce.spec b/rpm/SPECS/docker-ce.spec index 731d267d46..5c82df3a02 100644 --- a/rpm/SPECS/docker-ce.spec +++ b/rpm/SPECS/docker-ce.spec @@ -1,5 +1,7 @@ %global debug_package %{nil} +# BTRFS is enabled by default, but can be disabled by defining _without_btrfs +%{!?_with_btrfs: %{!?_without_btrfs: %define _with_btrfs 1}} Name: docker-ce Version: %{_version} @@ -33,7 +35,7 @@ Requires: xz Requires: device-mapper-libs >= 1.02.90-1 BuildRequires: bash -BuildRequires: btrfs-progs-devel +%{?_with_btrfs:BuildRequires: btrfs-progs-devel} BuildRequires: ca-certificates BuildRequires: cmake BuildRequires: device-mapper-devel @@ -83,7 +85,7 @@ export DOCKER_GITCOMMIT=%{_gitcommit} mkdir -p /go/src/github.com/docker ln -s /root/rpmbuild/BUILD/src/engine /go/src/github.com/docker/docker -pushd engine +pushd /root/rpmbuild/BUILD/src/engine for component in tini "proxy dynamic";do TMP_GOPATH="/go" hack/dockerfile/install/install.sh $component done diff --git a/rpm/centos-7/Dockerfile b/rpm/centos-7/Dockerfile index 2ea8306370..fadc377b89 100644 --- a/rpm/centos-7/Dockerfile +++ b/rpm/centos-7/Dockerfile @@ -17,10 +17,12 @@ ARG DISTRO ARG SUITE ENV DISTRO=${DISTRO} ENV SUITE=${SUITE} + +# In aarch64 (arm64) images, the altarch repo is specified as repository, but +# failing, so replace the URL. +RUN if [ -f /etc/yum.repos.d/CentOS-Sources.repo ]; then sed -i 's/altarch/centos/g' /etc/yum.repos.d/CentOS-Sources.repo; fi RUN yum install -y rpm-build rpmlint COPY SPECS /root/rpmbuild/SPECS -# Overwrite repo that was failing on aarch64 -RUN sed -i 's/altarch/centos/g' /etc/yum.repos.d/CentOS-Sources.repo RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec COPY --from=golang /usr/local/go /usr/local/go WORKDIR /root/rpmbuild diff --git a/rpm/centos-8/Dockerfile b/rpm/centos-8/Dockerfile new file mode 100644 index 0000000000..54220cc076 --- /dev/null +++ b/rpm/centos-8/Dockerfile @@ -0,0 +1,30 @@ +ARG GO_IMAGE +ARG DISTRO=centos +ARG SUITE=8 +ARG BUILD_IMAGE=${DISTRO}:${SUITE} + +FROM ${GO_IMAGE} AS golang + +FROM ${BUILD_IMAGE} +ENV GOPROXY=direct +ENV GO111MODULE=off +ENV GOPATH=/go +ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin +ENV AUTO_GOPATH 1 +ENV DOCKER_BUILDTAGS exclude_graphdriver_btrfs seccomp selinux +ENV RUNC_BUILDTAGS seccomp selinux +ARG DISTRO +ARG SUITE +ENV DISTRO=${DISTRO} +ENV SUITE=${SUITE} + +# In aarch64 (arm64) images, the altarch repo is specified as repository, but +# failing, so replace the URL. +RUN if [ -f /etc/yum.repos.d/CentOS-Sources.repo ]; then sed -i 's/altarch/centos/g' /etc/yum.repos.d/CentOS-Sources.repo; fi +RUN yum install -y rpm-build rpmlint yum-utils +RUN yum-config-manager --set-enabled PowerTools +COPY SPECS /root/rpmbuild/SPECS +RUN yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/*.spec +COPY --from=golang /usr/local/go /usr/local/go +WORKDIR /root/rpmbuild +ENTRYPOINT ["/bin/rpmbuild"] diff --git a/rpm/fedora-28/Dockerfile b/rpm/fedora-28/Dockerfile deleted file mode 100644 index 457da74bdb..0000000000 --- a/rpm/fedora-28/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -ARG GO_IMAGE -ARG BUILD_IMAGE=fedora:28 -FROM ${GO_IMAGE} as golang - -FROM ${BUILD_IMAGE} -ENV DISTRO fedora -ENV SUITE 28 -ENV GOPATH /go -ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin -ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS seccomp selinux -ENV RUNC_BUILDTAGS seccomp selinux -RUN dnf install -y rpm-build rpmlint dnf-plugins-core -COPY SPECS /root/rpmbuild/SPECS -RUN dnf builddep -y /root/rpmbuild/SPECS/*.spec -COPY --from=golang /usr/local/go /usr/local/go -WORKDIR /root/rpmbuild -ENTRYPOINT ["/bin/rpmbuild"] diff --git a/rpm/fedora-29/Dockerfile b/rpm/fedora-32/Dockerfile similarity index 97% rename from rpm/fedora-29/Dockerfile rename to rpm/fedora-32/Dockerfile index 6d688232d1..6468e8e0d7 100644 --- a/rpm/fedora-29/Dockerfile +++ b/rpm/fedora-32/Dockerfile @@ -1,6 +1,6 @@ ARG GO_IMAGE ARG DISTRO=fedora -ARG SUITE=29 +ARG SUITE=32 ARG BUILD_IMAGE=${DISTRO}:${SUITE} FROM ${GO_IMAGE} AS golang diff --git a/rpm/rhel-7/Dockerfile b/rpm/rhel-7/Dockerfile new file mode 100644 index 0000000000..62d5af64e1 --- /dev/null +++ b/rpm/rhel-7/Dockerfile @@ -0,0 +1,30 @@ +ARG GO_IMAGE +ARG DISTRO=rhel +ARG SUITE=7 +ARG BUILD_IMAGE=dockereng/${DISTRO}:${SUITE}-s390x + +FROM ${GO_IMAGE} AS golang + +FROM ${BUILD_IMAGE} +ENV GOPROXY=direct +ENV GO111MODULE=off +ENV GOPATH=/go +ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin +ENV AUTO_GOPATH 1 +ENV DOCKER_BUILDTAGS seccomp selinux +ENV RUNC_BUILDTAGS seccomp selinux +ARG DISTRO +ARG SUITE +ENV DISTRO=${DISTRO} +ENV SUITE=${SUITE} +ENV CC=gcc + +# In aarch64 (arm64) images, the altarch repo is specified as repository, but +# failing, so replace the URL. +RUN if [ -f /etc/yum.repos.d/CentOS-Sources.repo ]; then sed -i 's/altarch/centos/g' /etc/yum.repos.d/CentOS-Sources.repo; fi +RUN yum install -y rpm-build rpmlint +COPY SPECS /root/rpmbuild/SPECS +RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec +COPY --from=golang /usr/local/go /usr/local/go +WORKDIR /root/rpmbuild +ENTRYPOINT ["/bin/rpmbuild"]