Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 042b85e

Browse files
authored
Merge pull request #467 from thaJeztah/19.03_script_indents
[19.03 backport] changes from master (step 2) Upstream-commit: 1d69484247911b73639ae3284ba44683a3f04f6a Component: packaging
2 parents 0cca4f4 + 9efc9eb commit 042b85e

11 files changed

Lines changed: 89 additions & 83 deletions

File tree

components/packaging/Jenkinsfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ test_steps = [
1010
checkout scm
1111
sh('git clone https://github.com/docker/cli.git')
1212
sh("git -C cli checkout $branch")
13-
sh('git clone https://github.com/docker/engine.git')
13+
sh('git clone https://github.com/docker/docker.git engine')
1414
sh("git -C engine checkout $branch")
1515
sh('make -C deb VERSION=0.0.1-dev ENGINE_DIR=$(pwd)/engine CLI_DIR=$(pwd)/cli ubuntu-xenial ubuntu-focal')
1616
} finally {
@@ -26,7 +26,7 @@ test_steps = [
2626
checkout scm
2727
sh('git clone https://github.com/docker/cli.git')
2828
sh("git -C cli checkout $branch")
29-
sh('git clone https://github.com/docker/engine.git')
29+
sh('git clone https://github.com/docker/docker.git engine')
3030
sh("git -C engine checkout $branch")
3131
sh('make -C rpm VERSION=0.0.1-dev ENGINE_DIR=$(pwd)/engine CLI_DIR=$(pwd)/cli centos-7')
3232
} finally {
@@ -42,7 +42,7 @@ test_steps = [
4242
checkout scm
4343
sh('git clone https://github.com/docker/cli.git')
4444
sh("git -C cli checkout $branch")
45-
sh('git clone https://github.com/docker/engine.git')
45+
sh('git clone https://github.com/docker/docker.git engine')
4646
sh("git -C engine checkout $branch")
4747
sh('make VERSION=0.0.1-dev DOCKER_BUILD_PKGS=static-linux ENGINE_DIR=$(pwd)/engine CLI_DIR=$(pwd)/cli static')
4848
} finally {

components/packaging/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ The scripts will build for this list of packages types:
1010
* DEB packages for Ubuntu 20.04 Focal
1111
* DEB packages for Ubuntu 19.10 Eoan
1212
* DEB packages for Ubuntu 19.04 Disco
13-
* DEB packages for Ubuntu 18.10 Cosmic
1413
* DEB packages for Ubuntu 18.04 Bionic
1514
* DEB packages for Ubuntu 16.04 Xenial
1615
* DEB packages for Debian 10 Buster
1716
* DEB packages for Debian 9 Stretch
17+
* RPM packages for Fedora 32
1818
* RPM packages for Fedora 31
1919
* RPM packages for Fedora 30
20-
* RPM packages for Fedora 29
21-
* RPM packages for Fedora 28
2220
* RPM packages for CentOS 7
2321
* TGZ and ZIP files with static binaries

components/packaging/deb/Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,8 @@ RUN=docker run --rm -i \
3535
$(RUN_FLAGS) \
3636
debbuild-$@/$(ARCH)
3737

38-
SOURCE_FILES=cli.tgz engine.tgz docker.service docker.socket plugin-installers.tgz
39-
SOURCES=$(addprefix sources/, $(SOURCE_FILES))
40-
4138
DEBIAN_VERSIONS := debian-stretch debian-buster
42-
UBUNTU_VERSIONS := ubuntu-xenial ubuntu-bionic ubuntu-cosmic ubuntu-disco ubuntu-eoan ubuntu-focal
39+
UBUNTU_VERSIONS := ubuntu-xenial ubuntu-bionic ubuntu-disco ubuntu-eoan ubuntu-focal
4340
RASPBIAN_VERSIONS := raspbian-stretch raspbian-buster
4441
DISTROS := $(DEBIAN_VERSIONS) $(UBUNTU_VERSIONS) $(RASPBIAN_VERSIONS)
4542

@@ -67,7 +64,7 @@ debian: $(DEBIAN_VERSIONS) ## build all debian deb packages
6764
raspbian: $(RASPBIAN_VERSIONS) ## build all raspbian deb packages
6865

6966
.PHONY: $(DISTROS)
70-
$(DISTROS): $(SOURCES)
67+
$(DISTROS): sources/cli.tgz sources/engine.tgz sources/docker.service sources/docker.socket sources/plugin-installers.tgz
7168
@echo "== Building packages for $@ =="
7269
$(BUILD)
7370
$(RUN)

components/packaging/deb/ubuntu-cosmic/Dockerfile

Lines changed: 0 additions & 40 deletions
This file was deleted.

components/packaging/rpm/Makefile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ GO_IMAGE?=$(GO_BASE_IMAGE):$(GO_VERSION)-buster
1010
GEN_RPM_VER=$(shell ./gen-rpm-ver $(CLI_DIR) $(VERSION))
1111
CHOWN=docker run --rm -i -v $(CURDIR):/v -w /v alpine chown
1212

13-
DOCKERFILE=Dockerfile
14-
ifdef NEEDS_ARCH_SPECIFIC
15-
DOCKERFILE=Dockerfile.$(ARCH)
16-
endif
1713
ifdef BUILD_IMAGE
1814
BUILD_IMAGE_FLAG=--build-arg $(BUILD_IMAGE)
1915
endif
@@ -22,7 +18,7 @@ BUILD?=DOCKER_BUILDKIT=1 \
2218
$(BUILD_IMAGE_FLAG) \
2319
--build-arg GO_IMAGE=$(GO_IMAGE) \
2420
-t rpmbuild-$@/$(ARCH) \
25-
-f $@/$(DOCKERFILE) \
21+
-f $@/Dockerfile \
2622
.
2723

2824
SPEC_FILES?=docker-ce.spec docker-ce-cli.spec
@@ -37,14 +33,17 @@ RPMBUILD_FLAGS?=-ba\
3733
--define '_release $(word 2,$(GEN_RPM_VER))' \
3834
--define '_version $(word 1,$(GEN_RPM_VER))' \
3935
--define '_origversion $(word 4, $(GEN_RPM_VER))' \
36+
$(RPMBUILD_EXTRA_FLAGS) \
4037
$(SPECS)
4138
RUN?=$(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS)
4239

4340
SOURCE_FILES=engine.tgz cli.tgz docker.service docker.socket plugin-installers.tgz
4441
SOURCES=$(addprefix rpmbuild/SOURCES/, $(SOURCE_FILES))
4542

46-
FEDORA_RELEASES := fedora-31 fedora-30 fedora-29 fedora-28
47-
CENTOS_RELEASES := centos-7
43+
FEDORA_RELEASES := fedora-32 fedora-31 fedora-30
44+
CENTOS_RELEASES := centos-7 centos-8
45+
RHEL_RELEASES := rhel-7
46+
DISTROS := $(FEDORA_RELEASES) $(CENTOS_RELEASES) $(RHEL_RELEASES)
4847

4948
.PHONY: help
5049
help: ## show make targets
@@ -61,11 +60,17 @@ rpm: fedora centos ## build all rpm packages
6160
.PHONY: fedora
6261
fedora: $(FEDORA_RELEASES) ## build all fedora rpm packages
6362

63+
.PHONY: centos-8
64+
centos-8: RPMBUILD_EXTRA_FLAGS=--define '_without_btrfs 1'
65+
6466
.PHONY: centos
6567
centos: $(CENTOS_RELEASES) ## build all centos rpm packages
6668

67-
.PHONY: $(FEDORA_RELEASES) $(CENTOS_RELEASES)
68-
$(FEDORA_RELEASES) $(CENTOS_RELEASES): $(SOURCES)
69+
.PHONY: rhel
70+
rhel: $(RHEL_RELEASES) ## build all rhel rpm packages
71+
72+
.PHONY: $(DISTROS)
73+
$(DISTROS): rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz rpmbuild/SOURCES/docker.service rpmbuild/SOURCES/docker.socket rpmbuild/SOURCES/plugin-installers.tgz
6974
@echo "== Building packages for $@ =="
7075
$(CHOWN) -R root:root rpmbuild
7176
$(BUILD)

components/packaging/rpm/SPECS/docker-ce.spec

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
%global debug_package %{nil}
22

3+
# BTRFS is enabled by default, but can be disabled by defining _without_btrfs
4+
%{!?_with_btrfs: %{!?_without_btrfs: %define _with_btrfs 1}}
35

46
Name: docker-ce
57
Version: %{_version}
@@ -33,7 +35,7 @@ Requires: xz
3335
Requires: device-mapper-libs >= 1.02.90-1
3436

3537
BuildRequires: bash
36-
BuildRequires: btrfs-progs-devel
38+
%{?_with_btrfs:BuildRequires: btrfs-progs-devel}
3739
BuildRequires: ca-certificates
3840
BuildRequires: cmake
3941
BuildRequires: device-mapper-devel
@@ -83,7 +85,7 @@ export DOCKER_GITCOMMIT=%{_gitcommit}
8385
mkdir -p /go/src/github.com/docker
8486
ln -s /root/rpmbuild/BUILD/src/engine /go/src/github.com/docker/docker
8587

86-
pushd engine
88+
pushd /root/rpmbuild/BUILD/src/engine
8789
for component in tini "proxy dynamic";do
8890
TMP_GOPATH="/go" hack/dockerfile/install/install.sh $component
8991
done

components/packaging/rpm/centos-7/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ ARG DISTRO
1717
ARG SUITE
1818
ENV DISTRO=${DISTRO}
1919
ENV SUITE=${SUITE}
20+
21+
# In aarch64 (arm64) images, the altarch repo is specified as repository, but
22+
# failing, so replace the URL.
23+
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
2024
RUN yum install -y rpm-build rpmlint
2125
COPY SPECS /root/rpmbuild/SPECS
22-
# Overwrite repo that was failing on aarch64
23-
RUN sed -i 's/altarch/centos/g' /etc/yum.repos.d/CentOS-Sources.repo
2426
RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec
2527
COPY --from=golang /usr/local/go /usr/local/go
2628
WORKDIR /root/rpmbuild
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
ARG GO_IMAGE
2+
ARG DISTRO=centos
3+
ARG SUITE=8
4+
ARG BUILD_IMAGE=${DISTRO}:${SUITE}
5+
6+
FROM ${GO_IMAGE} AS golang
7+
8+
FROM ${BUILD_IMAGE}
9+
ENV GOPROXY=direct
10+
ENV GO111MODULE=off
11+
ENV GOPATH=/go
12+
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
13+
ENV AUTO_GOPATH 1
14+
ENV DOCKER_BUILDTAGS exclude_graphdriver_btrfs seccomp selinux
15+
ENV RUNC_BUILDTAGS seccomp selinux
16+
ARG DISTRO
17+
ARG SUITE
18+
ENV DISTRO=${DISTRO}
19+
ENV SUITE=${SUITE}
20+
21+
# In aarch64 (arm64) images, the altarch repo is specified as repository, but
22+
# failing, so replace the URL.
23+
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
24+
RUN yum install -y rpm-build rpmlint yum-utils
25+
RUN yum-config-manager --set-enabled PowerTools
26+
COPY SPECS /root/rpmbuild/SPECS
27+
RUN yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/*.spec
28+
COPY --from=golang /usr/local/go /usr/local/go
29+
WORKDIR /root/rpmbuild
30+
ENTRYPOINT ["/bin/rpmbuild"]

components/packaging/rpm/fedora-28/Dockerfile

Lines changed: 0 additions & 18 deletions
This file was deleted.

components/packaging/rpm/fedora-29/Dockerfile renamed to components/packaging/rpm/fedora-32/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG GO_IMAGE
22
ARG DISTRO=fedora
3-
ARG SUITE=29
3+
ARG SUITE=32
44
ARG BUILD_IMAGE=${DISTRO}:${SUITE}
55

66
FROM ${GO_IMAGE} AS golang

0 commit comments

Comments
 (0)