From 9df43900d64169149d5669ed1d812063d6589f50 Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Thu, 16 Aug 2018 23:40:13 +0000 Subject: [PATCH] Remove arch specific dockerfiles Signed-off-by: Eli Uriegas Upstream-commit: 0fd20b90cd322f0eeb06440833ba119b26f44d05 Component: packaging --- components/packaging/rpm/Makefile | 14 ++++++++------ .../centos-7/{Dockerfile.aarch64 => Dockerfile} | 4 +++- .../packaging/rpm/centos-7/Dockerfile.x86_64 | 17 ----------------- .../{Dockerfile.aarch64 => Dockerfile} | 0 .../packaging/rpm/fedora-27/Dockerfile.x86_64 | 17 ----------------- .../fedora-28/{Dockerfile.x86_64 => Dockerfile} | 0 .../packaging/rpm/fedora-28/Dockerfile.aarch64 | 17 ----------------- 7 files changed, 11 insertions(+), 58 deletions(-) rename components/packaging/rpm/centos-7/{Dockerfile.aarch64 => Dockerfile} (80%) delete mode 100644 components/packaging/rpm/centos-7/Dockerfile.x86_64 rename components/packaging/rpm/fedora-27/{Dockerfile.aarch64 => Dockerfile} (100%) delete mode 100644 components/packaging/rpm/fedora-27/Dockerfile.x86_64 rename components/packaging/rpm/fedora-28/{Dockerfile.x86_64 => Dockerfile} (100%) delete mode 100644 components/packaging/rpm/fedora-28/Dockerfile.aarch64 diff --git a/components/packaging/rpm/Makefile b/components/packaging/rpm/Makefile index a090795dd4d..d94f7a53420 100644 --- a/components/packaging/rpm/Makefile +++ b/components/packaging/rpm/Makefile @@ -10,6 +10,7 @@ GO_VERSION:=1.10.3 GO_IMAGE=$(GO_BASE_IMAGE):$(GO_VERSION) GEN_RPM_VER=$(shell ./gen-rpm-ver $(CLI_DIR) $(VERSION)) CHOWN=docker run --rm -i -v $(CURDIR):/v -w /v alpine chown +BUILD=docker build --build-arg GO_IMAGE=$(GO_IMAGE) -t rpmbuild-$@/$(ARCH) -f $@/Dockerfile . RPMBUILD=docker run --privileged --rm -i\ -v $(CURDIR)/rpmbuild/SOURCES:/root/rpmbuild/SOURCES \ -v $(CURDIR)/rpmbuild/RPMS:/root/rpmbuild/RPMS \ @@ -20,6 +21,7 @@ RPMBUILD_FLAGS=-ba\ --define '_version $(word 1,$(GEN_RPM_VER))' \ --define '_origversion $(word 4, $(GEN_RPM_VER))' \ SPECS/docker-ce.spec SPECS/docker-ce-cli.spec +RUN=$(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS) SOURCE_FILES=containerd-proxy.tgz cli.tgz containerd-shim-process.tar docker.service dockerd.json SOURCES=$(addprefix rpmbuild/SOURCES/, $(SOURCE_FILES)) @@ -50,24 +52,24 @@ centos: centos-7 ## build all centos rpm packages fedora-28: ## build fedora-28 rpm packages fedora-28: $(SOURCES) $(CHOWN) -R root:root rpmbuild - docker build --build-arg GO_IMAGE=$(GO_IMAGE) -t rpmbuild-$@/$(ARCH) -f $@/Dockerfile.$(ARCH) . - $(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS) + $(BUILD) + $(RUN) $(CHOWN) -R $(shell id -u):$(shell id -g) rpmbuild .PHONY: fedora-27 fedora-27: ## build fedora-27 rpm packages fedora-27: $(SOURCES) $(CHOWN) -R root:root rpmbuild - docker build --build-arg GO_IMAGE=$(GO_IMAGE) -t rpmbuild-$@/$(ARCH) -f $@/Dockerfile.$(ARCH) . - $(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS) + $(BUILD) + $(RUN) $(CHOWN) -R $(shell id -u):$(shell id -g) rpmbuild .PHONY: centos-7 centos-7: ## build centos-7 rpm packages centos-7: $(SOURCES) $(CHOWN) -R root:root rpmbuild - docker build --build-arg GO_IMAGE=$(GO_IMAGE) -t rpmbuild-$@/$(ARCH) -f $@/Dockerfile.$(ARCH) . - $(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS) + $(BUILD) + $(RUN) $(CHOWN) -R $(shell id -u):$(shell id -g) rpmbuild rpmbuild/SOURCES/cli.tgz: diff --git a/components/packaging/rpm/centos-7/Dockerfile.aarch64 b/components/packaging/rpm/centos-7/Dockerfile similarity index 80% rename from components/packaging/rpm/centos-7/Dockerfile.aarch64 rename to components/packaging/rpm/centos-7/Dockerfile index 0851a3ee9c1..6d5c01d55b5 100644 --- a/components/packaging/rpm/centos-7/Dockerfile.aarch64 +++ b/components/packaging/rpm/centos-7/Dockerfile @@ -9,8 +9,10 @@ ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin ENV AUTO_GOPATH 1 ENV DOCKER_BUILDTAGS pkcs11 seccomp selinux ENV RUNC_BUILDTAGS seccomp selinux -COPY SPECS /root/rpmbuild/SPECS 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/components/packaging/rpm/centos-7/Dockerfile.x86_64 b/components/packaging/rpm/centos-7/Dockerfile.x86_64 deleted file mode 100644 index b6334f62ddd..00000000000 --- a/components/packaging/rpm/centos-7/Dockerfile.x86_64 +++ /dev/null @@ -1,17 +0,0 @@ -ARG GO_IMAGE -FROM ${GO_IMAGE} as golang - -FROM centos:7 -ENV DISTRO centos -ENV SUITE 7 -ENV GOPATH=/go -ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin -ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS pkcs11 seccomp selinux -ENV RUNC_BUILDTAGS seccomp selinux -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"] diff --git a/components/packaging/rpm/fedora-27/Dockerfile.aarch64 b/components/packaging/rpm/fedora-27/Dockerfile similarity index 100% rename from components/packaging/rpm/fedora-27/Dockerfile.aarch64 rename to components/packaging/rpm/fedora-27/Dockerfile diff --git a/components/packaging/rpm/fedora-27/Dockerfile.x86_64 b/components/packaging/rpm/fedora-27/Dockerfile.x86_64 deleted file mode 100644 index ee2f8b08603..00000000000 --- a/components/packaging/rpm/fedora-27/Dockerfile.x86_64 +++ /dev/null @@ -1,17 +0,0 @@ -ARG GO_IMAGE -FROM ${GO_IMAGE} as golang - -FROM fedora:27 -ENV DISTRO fedora -ENV SUITE 27 -ENV GOPATH /go -ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin -ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS pkcs11 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/components/packaging/rpm/fedora-28/Dockerfile.x86_64 b/components/packaging/rpm/fedora-28/Dockerfile similarity index 100% rename from components/packaging/rpm/fedora-28/Dockerfile.x86_64 rename to components/packaging/rpm/fedora-28/Dockerfile diff --git a/components/packaging/rpm/fedora-28/Dockerfile.aarch64 b/components/packaging/rpm/fedora-28/Dockerfile.aarch64 deleted file mode 100644 index 797422fa8fa..00000000000 --- a/components/packaging/rpm/fedora-28/Dockerfile.aarch64 +++ /dev/null @@ -1,17 +0,0 @@ -ARG GO_IMAGE -FROM ${GO_IMAGE} as golang - -FROM fedora:28 -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 pkcs11 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"]