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
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ GOARCH=$(shell docker run --rm golang go env GOARCH 2>/dev/null)
ARCH:=$(shell uname -m)
REF?=$(shell git ls-remote https://github.com/containerd/containerd.git | grep master | awk '{print $$1}')
RUNC_REF?=029124da7af7360afa781a0234d1b083550f797c
PACKAGE?=containerd.io
GOVERSION?=1.11.8
GOLANG_IMAGE?=golang:1.11.8

Expand All @@ -21,6 +22,7 @@ BUILD=docker build \
$(BUILD_IMAGE_FLAG) \
--build-arg GOLANG_IMAGE="$(GOLANG_IMAGE)" \
--build-arg REF="$(REF)" \
--build-arg PACKAGE="$(PACKAGE)" \
--build-arg RUNC_REF="$(RUNC_REF)"

VOLUME_MOUNTS=-v "$(CURDIR)/build/DEB:/out" \
Expand All @@ -47,7 +49,7 @@ WIN_CRYPTO=dockereng/go-crypto-swap:windows-go1.11.8
# Build tags seccomp and apparmor are needed by CRI plugin.
BUILDTAGS ?= seccomp apparmor
GO_TAGS=$(if $(BUILDTAGS),-tags "$(BUILDTAGS)",)
GO_LDFLAGS=-ldflags '-s -w -X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PKG) $(EXTRA_LDFLAGS)'
GO_LDFLAGS=-ldflags '-s -w -X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) $(EXTRA_LDFLAGS)'

all: rpm deb

Expand Down
6 changes: 3 additions & 3 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ CONTAINERD_BINARIES=bin/containerd bin/containerd-shim bin/ctr
%:
dh $@ --with systemd

# GO_SRC_PATH are defined in the dockerfile
# GO_SRC_PATH and PACKAGE are defined in the dockerfile
# VERSION and REF are defined in scripts/build-deb
bin/%: ## Create containerd binaries
@echo "+ make -C $(GO_SRC_PATH) --no-print-directory VERSION=$${VERSION} REVISION=$${REF} $@"
@make -C $(GO_SRC_PATH) --no-print-directory VERSION=$${VERSION} REVISION=$${REF} $@
@echo "+ make -C $(GO_SRC_PATH) --no-print-directory VERSION=$${VERSION} REVISION=$${REF} PACKAGE=$${PACKAGE} $@"
@make -C $(GO_SRC_PATH) --no-print-directory VERSION=$${VERSION} REVISION=$${REF} PACKAGE=$${PACKAGE} $@
mkdir -p $(@D)
mv -v $(GO_SRC_PATH)/$@ $@

Expand Down
3 changes: 3 additions & 0 deletions dockerfiles/centos.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ COPY scripts/.rpm-helpers /.rpm-helpers
WORKDIR /root/rpmbuild
# Overwrite repo that was failing on aarch64
RUN sed -i 's/altarch/centos/g' /etc/yum.repos.d/CentOS-Sources.repo

ARG PACKAGE
ENV PACKAGE=${PACKAGE:-containerd.io}
ENTRYPOINT ["/build-rpm"]
3 changes: 3 additions & 0 deletions dockerfiles/centos.s390x.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ WORKDIR /root/rpmbuild
# Need for build-rpm on s390x
RUN ln /usr/bin/gcc /usr/bin/s390x-linux-gnu-gcc
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin

ARG PACKAGE
ENV PACKAGE=${PACKAGE:-containerd.io}
ENTRYPOINT ["/build-rpm"]
2 changes: 2 additions & 0 deletions dockerfiles/deb.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ RUN mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-reco
COPY scripts/build-deb /build-deb
COPY scripts/.helpers /.helpers

ARG PACKAGE
ENV PACKAGE=${PACKAGE:-containerd.io}
ENTRYPOINT ["/build-deb"]
3 changes: 3 additions & 0 deletions dockerfiles/fedora.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ COPY rpm/containerd.spec /root/rpmbuild/SPECS/containerd.spec
COPY scripts/build-rpm /build-rpm
COPY scripts/.rpm-helpers /.rpm-helpers
WORKDIR /root/rpmbuild

ARG PACKAGE
ENV PACKAGE=${PACKAGE:-containerd.io}
ENTRYPOINT ["/build-rpm"]
3 changes: 3 additions & 0 deletions dockerfiles/rhel.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ COPY rpm/containerd.spec /root/rpmbuild/SPECS/containerd.spec
COPY scripts/build-rpm /build-rpm
COPY scripts/.rpm-helpers /.rpm-helpers
WORKDIR /root/rpmbuild

ARG PACKAGE
ENV PACKAGE=${PACKAGE:-containerd.io}
ENTRYPOINT ["/build-rpm"]
3 changes: 3 additions & 0 deletions dockerfiles/sles.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ WORKDIR /root/rpmbuild
# suse puts the default build dir as /usr/src/rpmbuild
# to keep everything simple we just change the default
RUN echo "%_topdir /root/rpmbuild" > /root/.rpmmacros

ARG PACKAGE
ENV PACKAGE=${PACKAGE:-containerd.io}
ENTRYPOINT ["/build-rpm"]
2 changes: 1 addition & 1 deletion rpm/containerd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ cd %{_topdir}/BUILD
make man

pushd /go/src/%{import_path}
%define make_containerd(o:) make VERSION=%{getenv:VERSION} REVISION=%{getenv:REF} %{?**};
%define make_containerd(o:) make VERSION=%{getenv:VERSION} REVISION=%{getenv:REF} PACKAGE=%{getenv:PACKAGE} %{?**};
%make_containerd bin/containerd
/go/src/%{import_path}/bin/containerd --version
%make_containerd bin/containerd-shim
Expand Down