Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 2 additions & 5 deletions deb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
40 changes: 0 additions & 40 deletions deb/ubuntu-cosmic/Dockerfile

This file was deleted.

23 changes: 14 additions & 9 deletions rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions rpm/SPECS/docker-ce.spec
Original file line number Diff line number Diff line change
@@ -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}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions rpm/centos-7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 30 additions & 0 deletions rpm/centos-8/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
18 changes: 0 additions & 18 deletions rpm/fedora-28/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion rpm/fedora-29/Dockerfile → rpm/fedora-32/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
30 changes: 30 additions & 0 deletions rpm/rhel-7/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]