diff --git a/components/packaging/Makefile b/components/packaging/Makefile index 2293c613cd..251d42f0a4 100644 --- a/components/packaging/Makefile +++ b/components/packaging/Makefile @@ -21,7 +21,7 @@ rpm: ## build rpm packages $(MAKE) -C $@ VERSION=$(VERSION) PLUGIN_VERSION=$(PLUGIN_VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) $${p}; \ done -deb: DOCKER_BUILD_PKGS:=ubuntu-zesty ubuntu-xenial ubuntu-trusty debian-stretch debian-wheezy debian-jessie +deb: DOCKER_BUILD_PKGS:=ubuntu-zesty ubuntu-xenial ubuntu-trusty debian-stretch debian-wheezy debian-jessie raspbian-stretch raspbian-jessie deb: ## build deb packages $(MAKE) -C $@ metrics_plugin for p in $(DOCKER_BUILD_PKGS); do \ diff --git a/components/packaging/deb/Makefile b/components/packaging/deb/Makefile index 045acbfeb4..f81ff0b615 100644 --- a/components/packaging/deb/Makefile +++ b/components/packaging/deb/Makefile @@ -12,7 +12,7 @@ PLUGIN_VERSION?=1.0.0.$(KERNEL)-$(ARCH)-test DOCKER_EXPERIMENTAL:=0 CHOWN:=docker run --rm -v $(CURDIR):/v -w /v $(ALPINE_IMG) chown -.PHONY: help clean deb ubuntu debian ubuntu-xenial ubuntu-trusty ubuntu-zesty debian-jessie debian-stretch debian-wheezy +.PHONY: help clean deb ubuntu debian ubuntu-xenial ubuntu-trusty ubuntu-zesty debian-jessie debian-stretch debian-wheezy raspbian-jessie raspbian-stretch help: ## show make targets @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) @@ -21,12 +21,14 @@ clean: ## remove build artifacts [ ! -d debbuild ] || $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild $(RM) -r debbuild -deb: ubuntu debian ## build all deb packages +deb: ubuntu debian raspbian ## build all deb packages ubuntu: ubuntu-zesty ubuntu-xenial ubuntu-trusty ## build all ubuntu deb packages debian: debian-stretch debian-wheezy debian-jessie ## build all debian deb packages +raspbian: raspbian-stretch debian-jessie ## build all raspbian deb packages + metrics_plugin: ## pull telemetry plugin tarball mkdir -p $(PLUGIN_DIR) docker create --name tmp docker/telemetry-tgz:$(PLUGIN_VERSION) @@ -122,3 +124,33 @@ debian-wheezy: ## build debian wheezy deb packages -v $(COMMON_DIR):/root/build-deb/common \ debbuild-$@/$(ARCH) $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ + +raspbian-jessie: ## build raspbian jessie deb packages + docker build -t debbuild-$@/$(ARCH) -f $(CURDIR)/$@/Dockerfile.$(ARCH) . + docker run --rm -i \ + -e VERSION=$(VERSION) \ + -e DOCKER_GITCOMMIT=$(GITCOMMIT) \ + -e PLUGIN_VERSION=$(PLUGIN_VERSION) \ + -v $(CURDIR)/debbuild/$@:/build \ + -v $(ENGINE_DIR):/engine \ + -v $(PLUGIN_DIR):/plugin \ + -v $(CLI_DIR):/cli \ + -v $(CURDIR)/systemd:/root/build-deb/systemd \ + -v $(COMMON_DIR):/root/build-deb/common \ + debbuild-$@/$(ARCH) + $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ + +raspbian-stretch: ## build raspbian stretch deb packages + docker build -t debbuild-$@/$(ARCH) -f $(CURDIR)/$@/Dockerfile.$(ARCH) . + docker run --rm -i \ + -e VERSION=$(VERSION) \ + -e DOCKER_GITCOMMIT=$(GITCOMMIT) \ + -e PLUGIN_VERSION=$(PLUGIN_VERSION) \ + -v $(CURDIR)/debbuild/$@:/build \ + -v $(ENGINE_DIR):/engine \ + -v $(PLUGIN_DIR):/plugin \ + -v $(CLI_DIR):/cli \ + -v $(CURDIR)/systemd:/root/build-deb/systemd \ + -v $(COMMON_DIR):/root/build-deb/common \ + debbuild-$@/$(ARCH) + $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ diff --git a/components/packaging/deb/raspbian-jessie/Dockerfile.armv7l b/components/packaging/deb/raspbian-jessie/Dockerfile.armv7l new file mode 100644 index 0000000000..a6ec68a2e5 --- /dev/null +++ b/components/packaging/deb/raspbian-jessie/Dockerfile.armv7l @@ -0,0 +1,33 @@ +FROM resin/rpi-raspbian:jessie + +# allow replacing archive mirror +ARG APT_MIRROR=archive.raspbian.org +RUN sed -ri "s/archive.raspbian.org/$APT_MIRROR/g" /etc/apt/sources.list + +RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev pkg-config vim-common libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* + +ENV GO_VERSION 1.8.3 +ENV GOARM 6 +RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-armv6l.tar.gz" | tar xzC /usr/local +ENV GOPATH /go +ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin +ENV DOCKER_BUILDTAGS apparmor pkcs11 selinux +ENV RUNC_BUILDTAGS apparmor selinux + +COPY common/ /root/build-deb/debian +COPY build-deb /root/build-deb/build-deb + +RUN mkdir -p /go/src/github.com/docker && \ + mkdir -p /go/src/github.com/opencontainers && \ + ln -snf /engine /root/build-deb/engine && \ + ln -snf /cli /root/build-deb/cli && \ + ln -snf /root/build-deb/engine /go/src/github.com/docker/docker && \ + ln -snf /root/build-deb/cli /go/src/github.com/docker/cli + + +ENV DISTRO raspbian +ENV SUITE jessie + +WORKDIR /root/build-deb + +ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/raspbian-stretch/Dockerfile.armv7l b/components/packaging/deb/raspbian-stretch/Dockerfile.armv7l new file mode 100644 index 0000000000..738be12f0c --- /dev/null +++ b/components/packaging/deb/raspbian-stretch/Dockerfile.armv7l @@ -0,0 +1,33 @@ +FROM resin/rpi-raspbian:stretch + +# allow replacing archive mirror +ARG APT_MIRROR=archive.raspbian.org +RUN sed -ri "s/archive.raspbian.org/$APT_MIRROR/g" /etc/apt/sources.list + +RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libseccomp-dev pkg-config vim-common libsystemd-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* + +ENV GO_VERSION 1.8.3 +ENV GOARM 6 +RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-armv6l.tar.gz" | tar xzC /usr/local +ENV GOPATH /go +ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin +ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux +ENV RUNC_BUILDTAGS apparmor seccomp selinux + +COPY common/ /root/build-deb/debian +COPY build-deb /root/build-deb/build-deb + +RUN mkdir -p /go/src/github.com/docker && \ + mkdir -p /go/src/github.com/opencontainers && \ + ln -snf /engine /root/build-deb/engine && \ + ln -snf /cli /root/build-deb/cli && \ + ln -snf /root/build-deb/engine /go/src/github.com/docker/docker && \ + ln -snf /root/build-deb/cli /go/src/github.com/docker/cli + + +ENV DISTRO raspbian +ENV SUITE stretch + +WORKDIR /root/build-deb + +ENTRYPOINT ["/root/build-deb/build-deb"]