diff --git a/components/packaging/.gitignore b/components/packaging/.gitignore index b17df620f3..000ba3f5a5 100644 --- a/components/packaging/.gitignore +++ b/components/packaging/.gitignore @@ -1,3 +1,6 @@ build debbuild rpmbuild +tmp +artifacts +sources diff --git a/components/packaging/Jenkinsfile b/components/packaging/Jenkinsfile index 5ef5a94f2a..0ce470a856 100644 --- a/components/packaging/Jenkinsfile +++ b/components/packaging/Jenkinsfile @@ -1,5 +1,23 @@ #!groovy + +def genBranch(String arch) { + return [ + "${arch}": { -> + stage("Build engine image on ${arch}") { + wrappedNode(label: "linux&&${arch}", cleanWorkspace: true) { + try { + checkout scm + sh("git clone https://github.com/moby/moby.git engine") + sh('make ENGINE_DIR=$(pwd)/engine image') + } finally { + sh('make ENGINE_DIR=$(pwd)/engine clean-image clean-engine') + } + } + } + }] +} + test_steps = [ 'deb': { -> stage('Ubuntu Xenial Debian Package') { @@ -33,4 +51,16 @@ test_steps = [ }, ] +arches = [ + "x86_64", + // "s390x", + "ppc64le", + "aarch64", + "armhf" +] + +arches.each { + test_steps << genBranch(it) +} + parallel(test_steps) diff --git a/components/packaging/Makefile b/components/packaging/Makefile index ff8d0e876a..3dfabe68a8 100644 --- a/components/packaging/Makefile +++ b/components/packaging/Makefile @@ -3,14 +3,28 @@ ENGINE_DIR:=$(CURDIR)/../engine CLI_DIR:=$(CURDIR)/../cli VERSION?=0.0.0-dev DOCKER_GITCOMMIT:=abcdefg +ARCH=$(shell uname -m) +STATIC_VERSION=$(shell static/gen-static-ver $(ENGINE_DIR) $(VERSION)) GO_VERSION:=1.10.3 +# Taken from: https://www.cmcrossroads.com/article/printing-value-makefile-variable +print-% : ; @echo $($*) + .PHONY: help 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) +.PHONY: clean-engine +clean-engine: + rm -rf $(ENGINE_DIR) + +.PHONY: clean-image +clean-image: + $(MAKE) ENGINE_DIR=$(ENGINE_DIR) -C image clean + + .PHONY: clean -clean: ## remove build artifacts +clean: clean-image ## remove build artifacts $(MAKE) -C rpm clean $(MAKE) -C deb clean $(MAKE) -C static clean @@ -44,6 +58,9 @@ image: ## build static-compiled packages $(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) $${p}; \ done +engine-$(ARCH).tar: + $(MAKE) -C image $@ + .PHONY: release release: $(MAKE) -C image $@ diff --git a/components/packaging/common/dockerd.json b/components/packaging/common/dockerd.json new file mode 100644 index 0000000000..e96b9bc37b --- /dev/null +++ b/components/packaging/common/dockerd.json @@ -0,0 +1,12 @@ +{ + "image": "docker.io/${ENGINE_IMAGE}", + "imagePath": "/var/lib/docker-engine/engine.tar", + "namespace":"docker", + "args": [ + "-s", "overlay", + "--containerd", "/run/containerd/containerd.sock", + "--default-runtime", "containerd", + "--add-runtime", "containerd=runc" + ], + "scope": "ce" +} diff --git a/components/packaging/containerd.mk b/components/packaging/containerd.mk new file mode 100644 index 0000000000..12bad420f7 --- /dev/null +++ b/components/packaging/containerd.mk @@ -0,0 +1,17 @@ +# Common things for containerd functionality + +CONTAINERD_PROXY_COMMIT=82ae3d13e91d062dd4853379fe018638023c8da2 +CONTAINERD_SHIM_PROCESS_IMAGE=docker.io/docker/containerd-shim-process:ff98a47 + +# If containerd is running use that socket instead +ifeq ($(shell systemctl status containerd 2>/dev/null >/dev/null && echo -n "yes"), "yes") +CONTAINERD_SOCK:=/var/run/containerd/containerd.sock +else +CONTAINERD_SOCK:=/var/run/docker/containerd/docker-containerd.sock +endif +CTR=docker run \ + --rm -i \ + -v $(CONTAINERD_SOCK):/ours/containerd.sock \ + -v $(CURDIR)/artifacts:/artifacts \ + docker:18.06.0-ce \ + docker-containerd-ctr -a /ours/containerd.sock diff --git a/components/packaging/deb/Makefile b/components/packaging/deb/Makefile index cf1c668c18..8b38e170fb 100644 --- a/components/packaging/deb/Makefile +++ b/components/packaging/deb/Makefile @@ -1,26 +1,37 @@ +include ../containerd.mk + SHELL:=/bin/bash ARCH:=$(shell uname -m) -ENGINE_DIR:=$(CURDIR)/../../engine CLI_DIR:=$(CURDIR)/../../cli -GITCOMMIT?=$(shell cd $(ENGINE_DIR) && git rev-parse --short HEAD) +GITCOMMIT?=$(shell cd $(CLI_DIR) && git rev-parse --short HEAD) VERSION?=0.0.0-dev +GO_BASE_IMAGE=golang GO_VERSION:=1.10.3 -DEB_VERSION=$(shell ./gen-deb-ver $(ENGINE_DIR) "$(VERSION)") +GO_IMAGE=$(GO_BASE_IMAGE):$(GO_VERSION) +DEB_VERSION=$(shell ./gen-deb-ver $(CLI_DIR) "$(VERSION)") CHOWN:=docker run --rm -v $(CURDIR):/v -w /v alpine chown EPOCH?=2 -BUILD=docker build --build-arg GO_VERSION=$(GO_VERSION) -t debbuild-$@/$(ARCH) -f $(CURDIR)/$@/Dockerfile.$(ARCH) . +COMMON_FILES=common +BUILD?=docker build \ + --build-arg GO_IMAGE=$(GO_IMAGE) \ + --build-arg COMMON_FILES=$(COMMON_FILES) \ + -t debbuild-$@/$(ARCH) \ + -f $(CURDIR)/$@/Dockerfile . RUN=docker run --rm -i \ -e EPOCH='$(EPOCH)' \ -e DEB_VERSION=$(word 1, $(DEB_VERSION)) \ -e VERSION=$(word 2, $(DEB_VERSION)) \ -e DOCKER_GITCOMMIT=$(GITCOMMIT) \ -v $(CURDIR)/debbuild/$@:/build \ - -v $(ENGINE_DIR):/engine \ - -v $(CLI_DIR):/cli \ - -v $(CURDIR)/systemd:/root/build-deb/systemd \ debbuild-$@/$(ARCH) +SOURCE_FILES=containerd-proxy.tgz cli.tgz containerd-shim-process.tar docker.service dockerd.json engine.tar +SOURCES=$(addprefix sources/, $(SOURCE_FILES)) +ENGINE_IMAGE=docker/engine-community + +IMAGE_TAG=nightly + .PHONY: help 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) @@ -29,6 +40,15 @@ help: ## show make targets clean: ## remove build artifacts [ ! -d debbuild ] || $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild $(RM) -r debbuild + [ ! -d sources ] || $(CHOWN) -R $(shell id -u):$(shell id -g) sources + $(RM) -r sources + [ ! -d artifacts ] || $(CHOWN) -R $(shell id -u):$(shell id -g) artifacts + $(RM) -r artifacts + -docker rm docker2oci + +engine-$(ARCH).tar: + $(MAKE) -C ../image image-linux + docker save -o $@ $$(cat ../image/image-linux) .PHONY: deb deb: ubuntu debian raspbian ## build all deb packages @@ -42,50 +62,110 @@ debian: debian-stretch debian-jessie ## build all debian deb packages .PHONY: raspbian raspbian: raspbian-stretch debian-jessie ## build all raspbian deb packages +.PHONY: ubuntu-bionic +ubuntu-bionic: ## build ubuntu bionic deb packages +ubuntu-bionic: $(SOURCES) + $(BUILD) + $(RUN) + $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ + .PHONY: ubuntu-xenial ubuntu-xenial: ## build ubuntu xenial deb packages +ubuntu-xenial: $(SOURCES) $(BUILD) $(RUN) $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ .PHONY: ubuntu-trusty ubuntu-trusty: ## build ubuntu trusty deb packages - $(BUILD) - $(RUN) - $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ - -.PHONY: ubuntu-bionic -ubuntu-bionic: ## build ubuntu bionic deb packages +ubuntu-trusty: $(SOURCES) $(BUILD) $(RUN) $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ .PHONY: debian-buster debian-buster: ## build debian buster deb packages +debian-buster: $(SOURCES) $(BUILD) $(RUN) $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ .PHONY: debian-jessie debian-jessie: ## build debian jessie deb packages +debian-jessie: $(SOURCES) $(BUILD) $(RUN) $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ .PHONY: debian-stretch debian-stretch: ## build debian stretch deb packages +debian-stretch: $(SOURCES) $(BUILD) $(RUN) $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ .PHONY: raspbian-jessie raspbian-jessie: ## build raspbian jessie deb packages +raspbian-jessie: $(SOURCES) $(BUILD) $(RUN) $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ .PHONY: raspbian-stretch raspbian-stretch: ## build raspbian stretch deb packages +raspbian-stretch: $(SOURCES) $(BUILD) $(RUN) $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ + +sources/cli.tgz: + mkdir -p $(@D) + docker run --rm -i -w /v \ + -v $(CLI_DIR):/cli \ + -v $(CURDIR)/$(@D):/v \ + alpine \ + tar -C / -c -z -f /v/cli.tgz --exclude .git cli + +sources/containerd-proxy.tgz: + mkdir -p tmp/ + curl -fL -o tmp/containerd-proxy.tgz "https://github.com/crosbymichael/containerd-proxy/archive/$(CONTAINERD_PROXY_COMMIT).tar.gz" + tar xzf tmp/containerd-proxy.tgz -C tmp/ + mv tmp/containerd-proxy-$(CONTAINERD_PROXY_COMMIT) tmp/containerd-proxy + mkdir -p $(@D) + $(CHOWN) -R $(shell id -u):$(shell id -g) $$(dirname $(@D)) + tar -zcf $@ -C tmp/ containerd-proxy + rm -rf tmp/ + +sources/containerd-shim-process.tar: + $(CTR) content fetch $(CONTAINERD_SHIM_PROCESS_IMAGE) + $(CTR) image export artifacts/containerd-shim-process.tar $(CONTAINERD_SHIM_PROCESS_IMAGE) + mkdir -p $(@D) + cp artifacts/containerd-shim-process.tar $@ + $(CHOWN) -R $(shell id -u):$(shell id -g) $$(dirname $(@D)) + +sources/docker.service: ../systemd/docker.service + mkdir -p $(@D) + cp $< $@ + +sources/dockerd.json: ../common/dockerd.json + mkdir -p $(@D) + sed -e 's!$${ENGINE_IMAGE}!$(ENGINE_IMAGE)!' -e 's/$${IMAGE_TAG}/$(IMAGE_TAG)/' $< > $@ + +# TODO: Eventually clean this up when we release an image with a manifest +DOCKER2OCI=artifacts/docker2oci +$(DOCKER2OCI): + -$(CHOWN) -R $(shell id -u):$(shell id -g) $(@D) + docker run --name docker2oci $(GO_IMAGE) sh -c 'go get github.com/coolljt0725/docker2oci' + mkdir -p $(@D) + docker cp docker2oci:/go/bin/docker2oci "$@" + docker rm -f docker2oci + $(CHOWN) -R $(shell id -u):$(shell id -g) $(@D) + +# offline bundle +sources/engine.tar: $(DOCKER2OCI) + $(MAKE) -C ../image ENGINE_IMAGE=$(ENGINE_IMAGE) image-linux + mkdir -p artifacts + docker save -o artifacts/docker-engine.tar $$(cat ../image/image-linux) + ./$(DOCKER2OCI) -i artifacts/docker-engine.tar artifacts/engine-image + mkdir -p $(@D) + tar c -C artifacts/engine-image . > $@ diff --git a/components/packaging/deb/build-deb b/components/packaging/deb/build-deb index bb25ffdd07..da4eb3f7d0 100755 --- a/components/packaging/deb/build-deb +++ b/components/packaging/deb/build-deb @@ -13,18 +13,9 @@ if [[ -z "$DEB_VERSION" ]]; then exit 1 fi -( - set -e - cd engine - # I want to rip this install-binaries script out so badly - for component in tini "proxy dynamic" "runc all" "containerd dynamic";do - TMP_GOPATH="/go" hack/dockerfile/install/install.sh $component - done -) - echo VERSION AAA $VERSION -VERSION=${VERSION:-$( cat engine/VERSION )} +VERSION=${VERSION:-$( cat cli/VERSION )} echo VERSION bbb $VERSION @@ -40,7 +31,7 @@ EOF # The space above at the start of the line for the debMaintainer is very important # Give the script a git commit because it wants it -export DOCKER_GITCOMMIT=${DOCKER_GITCOMMIT-$($GIT_COMMAND rev-parse --short HEAD)} +export DOCKER_GITCOMMIT=${DOCKER_GITCOMMIT-$(cd cli; $GIT_COMMAND rev-parse --short HEAD)} echo VERSION BBB $VERSION dpkg-buildpackage -uc -us -I.git diff --git a/components/packaging/deb/common/control b/components/packaging/deb/common/control index a12448f1a8..6b3e3532a6 100644 --- a/components/packaging/deb/common/control +++ b/components/packaging/deb/common/control @@ -2,22 +2,28 @@ Source: docker-ce Section: admin Priority: optional Maintainer: Docker +Build-Depends: bash-completion, + dh-apparmor, + dh-systemd, + libltdl-dev, + make, + gcc Standards-Version: 3.9.6 -Homepage: https://dockerproject.org +Homepage: https://docker.com Vcs-Browser: https://github.com/docker/docker Vcs-Git: git://github.com/docker/docker.git Package: docker-ce Architecture: linux-any -Depends: iptables, ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends} -Recommends: aufs-tools, +Depends: docker-ce-cli, containerd.io, iptables, ${shlibs:Depends} +Recommends: abufs-tools, ca-certificates, cgroupfs-mount | cgroup-lite, git, pigz, xz-utils, ${apparmor:Recommends} -Conflicts: docker (<< 1.5~), docker.io, lxc-docker, lxc-docker-virtual-package, docker-engine, docker-engine-cs, docker-ee +Conflicts: docker (<< 1.5~), docker.io, lxc-docker, lxc-docker-virtual-package, docker-engine, docker-engine-cs Replaces: docker-engine Description: Docker: the open-source application container engine Docker is an open source project to build, ship and run any application as a @@ -29,3 +35,19 @@ Description: Docker: the open-source application container engine language, framework or packaging system. That makes them great building blocks for deploying and scaling web apps, databases, and backend services without depending on a particular stack or provider. + +Package: docker-ce-cli +Architecture: linux-any +Depends: ${shlibs:Depends} +Conflicts: docker (<< 1.5~), docker.io, lxc-docker, lxc-docker-virtual-package, docker-engine, docker-engine-cs +Replaces: +Description: Docker CLI: the open-source application container engine + Docker is an open source project to build, ship and run any application as a + lightweight container + . + Docker containers are both hardware-agnostic and platform-agnostic. This means + they can run anywhere, from your laptop to the largest EC2 compute instance and + everything in between - and they don't require you to use a particular + language, framework or packaging system. That makes them great building blocks + for deploying and scaling web apps, databases, and backend services without + depending on a particular stack or provider. diff --git a/components/packaging/deb/common/docker-ce.bash-completion b/components/packaging/deb/common/docker-ce-cli.bash-completion similarity index 100% rename from components/packaging/deb/common/docker-ce.bash-completion rename to components/packaging/deb/common/docker-ce-cli.bash-completion diff --git a/components/packaging/deb/common/docker-ce.manpages b/components/packaging/deb/common/docker-ce-cli.manpages similarity index 100% rename from components/packaging/deb/common/docker-ce.manpages rename to components/packaging/deb/common/docker-ce-cli.manpages diff --git a/components/packaging/deb/common/docker-ce.docker.default b/components/packaging/deb/common/docker-ce.docker.default deleted file mode 100644 index c4e93199b4..0000000000 --- a/components/packaging/deb/common/docker-ce.docker.default +++ /dev/null @@ -1,20 +0,0 @@ -# Docker Upstart and SysVinit configuration file - -# -# THIS FILE DOES NOT APPLY TO SYSTEMD -# -# Please see the documentation for "systemd drop-ins": -# https://docs.docker.com/engine/admin/systemd/ -# - -# Customize location of Docker binary (especially for development testing). -#DOCKERD="/usr/local/bin/dockerd" - -# Use DOCKER_OPTS to modify the daemon startup options. -#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4" - -# If you need Docker to use an HTTP proxy, it can also be specified here. -#export http_proxy="http://127.0.0.1:3128/" - -# This is also a handy place to tweak where Docker's temporary files go. -#export DOCKER_TMPDIR="/mnt/bigdrive/docker-tmp" diff --git a/components/packaging/deb/common/docker-ce.docker.init b/components/packaging/deb/common/docker-ce.docker.init deleted file mode 100644 index 9c8fa6be73..0000000000 --- a/components/packaging/deb/common/docker-ce.docker.init +++ /dev/null @@ -1,156 +0,0 @@ -#!/bin/sh -set -e - -### BEGIN INIT INFO -# Provides: docker -# Required-Start: $syslog $remote_fs -# Required-Stop: $syslog $remote_fs -# Should-Start: cgroupfs-mount cgroup-lite -# Should-Stop: cgroupfs-mount cgroup-lite -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Create lightweight, portable, self-sufficient containers. -# Description: -# Docker is an open-source project to easily create lightweight, portable, -# self-sufficient containers from any application. The same container that a -# developer builds and tests on a laptop can run at scale, in production, on -# VMs, bare metal, OpenStack clusters, public clouds and more. -### END INIT INFO - -export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin - -BASE=docker - -# modify these in /etc/default/$BASE (/etc/default/docker) -DOCKERD=/usr/bin/dockerd -# This is the pid file managed by docker itself -DOCKER_PIDFILE=/var/run/$BASE.pid -# This is the pid file created/managed by start-stop-daemon -DOCKER_SSD_PIDFILE=/var/run/$BASE-ssd.pid -DOCKER_LOGFILE=/var/log/$BASE.log -DOCKER_OPTS= -DOCKER_DESC="Docker" - -# Get lsb functions -. /lib/lsb/init-functions - -if [ -f /etc/default/$BASE ]; then - . /etc/default/$BASE -fi - -# Check docker is present -if [ ! -x $DOCKERD ]; then - log_failure_msg "$DOCKERD not present or not executable" - exit 1 -fi - -check_init() { - # see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it directly) - if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | grep -q upstart; then - log_failure_msg "$DOCKER_DESC is managed via upstart, try using service $BASE $1" - exit 1 - fi -} - -fail_unless_root() { - if [ "$(id -u)" != '0' ]; then - log_failure_msg "$DOCKER_DESC must be run as root" - exit 1 - fi -} - -cgroupfs_mount() { - # see also https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount - if grep -v '^#' /etc/fstab | grep -q cgroup \ - || [ ! -e /proc/cgroups ] \ - || [ ! -d /sys/fs/cgroup ]; then - return - fi - if ! mountpoint -q /sys/fs/cgroup; then - mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup - fi - ( - cd /sys/fs/cgroup - for sys in $(awk '!/^#/ { if ($4 == 1) print $1 }' /proc/cgroups); do - mkdir -p $sys - if ! mountpoint -q $sys; then - if ! mount -n -t cgroup -o $sys cgroup $sys; then - rmdir $sys || true - fi - fi - done - ) -} - -case "$1" in - start) - check_init - - fail_unless_root - - cgroupfs_mount - - touch "$DOCKER_LOGFILE" - chgrp docker "$DOCKER_LOGFILE" - - ulimit -n 1048576 - - # Having non-zero limits causes performance problems due to accounting overhead - # in the kernel. We recommend using cgroups to do container-local accounting. - if [ "$BASH" ]; then - ulimit -u unlimited - else - ulimit -p unlimited - fi - - log_begin_msg "Starting $DOCKER_DESC: $BASE" - start-stop-daemon --start --background \ - --no-close \ - --exec "$DOCKERD" \ - --pidfile "$DOCKER_SSD_PIDFILE" \ - --make-pidfile \ - -- \ - -p "$DOCKER_PIDFILE" \ - $DOCKER_OPTS \ - >> "$DOCKER_LOGFILE" 2>&1 - log_end_msg $? - ;; - - stop) - check_init - fail_unless_root - if [ -f "$DOCKER_SSD_PIDFILE" ]; then - log_begin_msg "Stopping $DOCKER_DESC: $BASE" - start-stop-daemon --stop --pidfile "$DOCKER_SSD_PIDFILE" --retry 10 - log_end_msg $? - else - log_warning_msg "Docker already stopped - file $DOCKER_SSD_PIDFILE not found." - fi - ;; - - restart) - check_init - fail_unless_root - docker_pid=`cat "$DOCKER_SSD_PIDFILE" 2>/dev/null` - [ -n "$docker_pid" ] \ - && ps -p $docker_pid > /dev/null 2>&1 \ - && $0 stop - $0 start - ;; - - force-reload) - check_init - fail_unless_root - $0 restart - ;; - - status) - check_init - status_of_proc -p "$DOCKER_SSD_PIDFILE" "$DOCKERD" "$DOCKER_DESC" - ;; - - *) - echo "Usage: service docker {start|stop|restart|status}" - exit 1 - ;; -esac diff --git a/components/packaging/deb/common/docker-ce.docker.upstart b/components/packaging/deb/common/docker-ce.docker.upstart deleted file mode 100644 index d58f7d6ac8..0000000000 --- a/components/packaging/deb/common/docker-ce.docker.upstart +++ /dev/null @@ -1,72 +0,0 @@ -description "Docker daemon" - -start on (filesystem and net-device-up IFACE!=lo) -stop on runlevel [!2345] - -limit nofile 524288 1048576 - -# Having non-zero limits causes performance problems due to accounting overhead -# in the kernel. We recommend using cgroups to do container-local accounting. -limit nproc unlimited unlimited - -respawn - -kill timeout 20 - -pre-start script - # see also https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount - if grep -v '^#' /etc/fstab | grep -q cgroup \ - || [ ! -e /proc/cgroups ] \ - || [ ! -d /sys/fs/cgroup ]; then - exit 0 - fi - if ! mountpoint -q /sys/fs/cgroup; then - mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup - fi - ( - cd /sys/fs/cgroup - for sys in $(awk '!/^#/ { if ($4 == 1) print $1 }' /proc/cgroups); do - mkdir -p $sys - if ! mountpoint -q $sys; then - if ! mount -n -t cgroup -o $sys cgroup $sys; then - rmdir $sys || true - fi - fi - done - ) -end script - -script - # modify these in /etc/default/$UPSTART_JOB (/etc/default/docker) - DOCKERD=/usr/bin/dockerd - DOCKER_OPTS= - if [ -f /etc/default/$UPSTART_JOB ]; then - . /etc/default/$UPSTART_JOB - fi - exec "$DOCKERD" $DOCKER_OPTS --raw-logs -end script - -# Don't emit "started" event until docker.sock is ready. -# See https://github.com/docker/docker/issues/6647 -post-start script - DOCKER_OPTS= - DOCKER_SOCKET= - if [ -f /etc/default/$UPSTART_JOB ]; then - . /etc/default/$UPSTART_JOB - fi - - if ! printf "%s" "$DOCKER_OPTS" | grep -qE -e '-H|--host'; then - DOCKER_SOCKET=/var/run/docker.sock - else - DOCKER_SOCKET=$(printf "%s" "$DOCKER_OPTS" | grep -oP -e '(-H|--host)\W*unix://\K(\S+)' | sed 1q) - fi - - if [ -n "$DOCKER_SOCKET" ]; then - while ! [ -e "$DOCKER_SOCKET" ]; do - initctl status $UPSTART_JOB | grep -qE "(stop|respawn)/" && exit 1 - echo "Waiting for $DOCKER_SOCKET" - sleep 0.1 - done - echo "$DOCKER_SOCKET is up" - fi -end script diff --git a/components/packaging/deb/common/docker-ce.install b/components/packaging/deb/common/docker-ce.install deleted file mode 100644 index 1e23903064..0000000000 --- a/components/packaging/deb/common/docker-ce.install +++ /dev/null @@ -1,11 +0,0 @@ -#engine/contrib/syntax/vim/doc/* /usr/share/vim/vimfiles/doc/ -#engine/contrib/syntax/vim/ftdetect/* /usr/share/vim/vimfiles/ftdetect/ -#engine/contrib/syntax/vim/syntax/* /usr/share/vim/vimfiles/syntax/ -engine/contrib/check-config.sh usr/share/docker-ce/contrib/ -cli/contrib/completion/fish/docker.fish usr/share/fish/vendor_completions.d/ -cli/contrib/completion/zsh/_docker usr/share/zsh/vendor-completions/ -systemd/docker.service lib/systemd/system/ -systemd/docker.socket lib/systemd/system/ -engine/contrib/mk* usr/share/docker-ce/contrib/ -engine/contrib/nuke-graph-directory.sh usr/share/docker-ce/contrib/ -engine/contrib/syntax/nano/Dockerfile.nanorc usr/share/nano/ diff --git a/components/packaging/deb/common/docker-ce.udev b/components/packaging/deb/common/docker-ce.udev deleted file mode 100644 index f934c01757..0000000000 --- a/components/packaging/deb/common/docker-ce.udev +++ /dev/null @@ -1,3 +0,0 @@ -# hide docker's loopback devices from udisks, and thus from user desktops -SUBSYSTEM=="block", ENV{DM_NAME}=="docker-*", ENV{UDISKS_PRESENTATION_HIDE}="1", ENV{UDISKS_IGNORE}="1" -SUBSYSTEM=="block", DEVPATH=="/devices/virtual/block/loop*", ATTR{loop/backing_file}=="/var/lib/docker/*", ENV{UDISKS_PRESENTATION_HIDE}="1", ENV{UDISKS_IGNORE}="1" diff --git a/components/packaging/deb/common/docs b/components/packaging/deb/common/docs index 073f189abb..1e89a49202 100644 --- a/components/packaging/deb/common/docs +++ b/components/packaging/deb/common/docs @@ -1 +1 @@ -engine/README.md +cli/README.md diff --git a/components/packaging/deb/common/rules b/components/packaging/deb/common/rules index f75a8eafce..73a2ffb159 100644 --- a/components/packaging/deb/common/rules +++ b/components/packaging/deb/common/rules @@ -1,8 +1,6 @@ #!/usr/bin/make -f VERSION ?= $(shell cat engine/VERSION) -SYSTEMD_VERSION := $(shell dpkg-query -W -f='$${Version}\n' systemd libsystemd-dev | head -1 | cut -d- -f1) -SYSTEMD_GT_227 := $(shell [ '$(SYSTEMD_VERSION)' ] && [ '$(SYSTEMD_VERSION)' -gt 227 ] && echo true ) override_dh_gencontrol: # if we're on Ubuntu, we need to Recommends: apparmor @@ -10,41 +8,30 @@ override_dh_gencontrol: dh_gencontrol override_dh_auto_build: - cd engine && ./hack/make.sh dynbinary - cd /go/src/github.com/docker/cli && LDFLAGS='' make VERSION=$(VERSION) GITCOMMIT=$(DOCKER_GITCOMMIT) dynbinary manpages - -override_dh_auto_test: - ./engine/bundles/dynbinary-daemon/dockerd -v + cd /go/src/github.com/docker/cli && \ + LDFLAGS='' DISABLE_WARN_OUTSIDE_CONTAINER=1 make VERSION=$(VERSION) GITCOMMIT=$(DOCKER_GITCOMMIT) dynbinary manpages + cd /go/src/github.com/crosbymichael/containerd-proxy && \ + make SCOPE_LABEL="com.docker/containerd-proxy.scope" ANY_SCOPE="ee" bin/containerd-proxy override_dh_strip: # Go has lots of problems with stripping, so just don't override_dh_auto_install: - mkdir -p debian/docker-ce/usr/bin - cp -aTL cli/build/docker debian/docker-ce/usr/bin/docker - cp -aT "$$(readlink -f engine/bundles/dynbinary-daemon/dockerd)" debian/docker-ce/usr/bin/dockerd - cp -aT /usr/local/bin/docker-proxy debian/docker-ce/usr/bin/docker-proxy - cp -aT /usr/local/bin/docker-containerd debian/docker-ce/usr/bin/docker-containerd - cp -aT /usr/local/bin/docker-containerd-shim debian/docker-ce/usr/bin/docker-containerd-shim - cp -aT /usr/local/bin/docker-containerd-ctr debian/docker-ce/usr/bin/docker-containerd-ctr - cp -aT /usr/local/bin/docker-runc debian/docker-ce/usr/bin/docker-runc - cp -aT /usr/local/bin/docker-init debian/docker-ce/usr/bin/docker-init - mkdir -p debian/docker-ce/usr/lib/docker + # docker-ce-cli install + install -D -m 0644 /go/src/github.com/docker/cli/contrib/completion/fish/docker.fish debian/docker-ce-cli/usr/share/fish/vendor_completions.d/docker.fish + install -D -m 0644 /go/src/github.com/docker/cli/contrib/completion/zsh/_docker debian/docker-ce-cli/usr/share/zsh/vendor-completions/_docker + install -D -m 0755 /go/src/github.com/docker/cli/build/docker debian/docker-ce-cli/usr/bin/docker + # docker-ce install + install -D -m 0755 /go/src/github.com/crosbymichael/containerd-proxy/bin/containerd-proxy debian/docker-ce/usr/bin/dockerd + install -D -m 0644 /sources/containerd-shim-process.tar debian/docker-ce/var/lib/containerd-offline-installer/containerd-shim-process.tar + install -D -m 0644 /sources/engine.tar debian/docker-ce/var/lib/docker-engine/engine.tar + install -D -m 0644 /sources/docker.service debian/docker-ce/lib/systemd/system/docker.service + install -D -m 0644 /sources/dockerd.json debian/docker-ce/etc/containerd-proxy/dockerd.json -override_dh_installinit: - # use "docker" as our service name, not "docker-ce" - dh_installinit --name=docker -ifeq (true, $(SYSTEMD_GT_227)) - $(warning "Setting TasksMax=infinity") - sed -i -- 's/#TasksMax=infinity/TasksMax=infinity/' debian/docker-ce/lib/systemd/system/docker.service -endif - -override_dh_installudev: - # match our existing priority - dh_installudev --priority=z80 override_dh_install: dh_install + # TODO Can we do this from within our container? dh_apparmor --profile-name=docker-ce -pdocker-ce override_dh_shlibdeps: diff --git a/components/packaging/deb/debian-buster/Dockerfile b/components/packaging/deb/debian-buster/Dockerfile new file mode 100644 index 0000000000..7f2613f45b --- /dev/null +++ b/components/packaging/deb/debian-buster/Dockerfile @@ -0,0 +1,33 @@ +ARG GO_IMAGE +FROM ${GO_IMAGE} as golang + +FROM debian:buster + +RUN apt-get update && apt-get install -y curl devscripts equivs git + +ARG GO_VERSION +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 + +ARG COMMON_FILES +COPY ${COMMON_FILES} /root/build-deb/debian +RUN mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/build-deb/debian/control + +# Copy our sources and untar them +COPY sources/ /sources +RUN mkdir -p /go/src/github.com/docker/ && tar -xzf /sources/cli.tgz -C /go/src/github.com/docker/ +RUN mkdir -p /go/src/github.com/crosbymichael && tar -xzf /sources/containerd-proxy.tgz -C /go/src/github.com/crosbymichael + +RUN ln -snf /go/src/github.com/docker/cli /root/build-deb/cli + +ENV DISTRO debian +ENV SUITE buster + +COPY --from=golang /usr/local/go /usr/local/go + +WORKDIR /root/build-deb +COPY build-deb /root/build-deb/build-deb + +ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/debian-buster/Dockerfile.aarch64 b/components/packaging/deb/debian-buster/Dockerfile.aarch64 deleted file mode 100644 index 08a3293e31..0000000000 --- a/components/packaging/deb/debian-buster/Dockerfile.aarch64 +++ /dev/null @@ -1,32 +0,0 @@ -FROM debian:buster - -# allow replacing httpredir or deb mirror -ARG APT_MIRROR=deb.debian.org -RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list - -RUN apt-get update && apt-get install -y apparmor bash-completion libbtrfs-dev 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 gnupg dirmngr --no-install-recommends && rm -rf /var/lib/apt/lists/* - -ARG GO_VERSION -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-arm64.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 debian -ENV SUITE buster - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/debian-buster/Dockerfile.armv7l b/components/packaging/deb/debian-buster/Dockerfile.armv7l deleted file mode 100644 index ba22d4068c..0000000000 --- a/components/packaging/deb/debian-buster/Dockerfile.armv7l +++ /dev/null @@ -1,32 +0,0 @@ -FROM arm32v7/debian:buster - -# allow replacing httpredir or deb mirror -ARG APT_MIRROR=deb.debian.org -RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list - -RUN apt-get update && apt-get install -y apparmor bash-completion libbtrfs-dev 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/* - -ARG GO_VERSION -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 debian -ENV SUITE buster - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/debian-buster/Dockerfile.x86_64 b/components/packaging/deb/debian-buster/Dockerfile.x86_64 deleted file mode 100644 index 26aaad9c24..0000000000 --- a/components/packaging/deb/debian-buster/Dockerfile.x86_64 +++ /dev/null @@ -1,32 +0,0 @@ -FROM debian:buster - -# allow replacing httpredir or deb mirror -ARG APT_MIRROR=deb.debian.org -RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list - -RUN apt-get update && apt-get install -y apparmor bash-completion libbtrfs-dev 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/* - -ARG GO_VERSION -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.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 debian -ENV SUITE buster - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/debian-jessie/Dockerfile b/components/packaging/deb/debian-jessie/Dockerfile new file mode 100644 index 0000000000..03a7ce4cc8 --- /dev/null +++ b/components/packaging/deb/debian-jessie/Dockerfile @@ -0,0 +1,33 @@ +ARG GO_IMAGE +FROM ${GO_IMAGE} as golang + +FROM debian:jessie + +RUN apt-get update && apt-get install -y curl devscripts equivs git + +ARG GO_VERSION +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 + +ARG COMMON_FILES +COPY ${COMMON_FILES} /root/build-deb/debian +RUN mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/build-deb/debian/control + +# Copy our sources and untar them +COPY sources/ /sources +RUN mkdir -p /go/src/github.com/docker/ && tar -xzf /sources/cli.tgz -C /go/src/github.com/docker/ +RUN mkdir -p /go/src/github.com/crosbymichael && tar -xzf /sources/containerd-proxy.tgz -C /go/src/github.com/crosbymichael + +RUN ln -snf /go/src/github.com/docker/cli /root/build-deb/cli + +ENV DISTRO debian +ENV SUITE jessie + +COPY --from=golang /usr/local/go /usr/local/go + +WORKDIR /root/build-deb +COPY build-deb /root/build-deb/build-deb + +ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/debian-jessie/Dockerfile.armv7l b/components/packaging/deb/debian-jessie/Dockerfile.armv7l deleted file mode 100644 index 32086270d8..0000000000 --- a/components/packaging/deb/debian-jessie/Dockerfile.armv7l +++ /dev/null @@ -1,32 +0,0 @@ -FROM arm32v7/debian:jessie - -# allow replacing httpredir or deb mirror -ARG APT_MIRROR=deb.debian.org -RUN sed -ri "s/(httpredir|deb).debian.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 libudev-dev pkg-config vim-common libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* - -ARG GO_VERSION -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 debian -ENV SUITE jessie - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/debian-jessie/Dockerfile.x86_64 b/components/packaging/deb/debian-jessie/Dockerfile.x86_64 deleted file mode 100644 index ee276885b8..0000000000 --- a/components/packaging/deb/debian-jessie/Dockerfile.x86_64 +++ /dev/null @@ -1,32 +0,0 @@ -FROM debian:jessie - -# allow replacing httpredir or deb mirror -ARG APT_MIRROR=deb.debian.org -RUN sed -ri "s/(httpredir|deb).debian.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 libudev-dev pkg-config vim-common libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* - -ARG GO_VERSION -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.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 debian -ENV SUITE jessie - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/debian-stretch/Dockerfile b/components/packaging/deb/debian-stretch/Dockerfile new file mode 100644 index 0000000000..3037785979 --- /dev/null +++ b/components/packaging/deb/debian-stretch/Dockerfile @@ -0,0 +1,33 @@ +ARG GO_IMAGE +FROM ${GO_IMAGE} as golang + +FROM debian:stretch + +RUN apt-get update && apt-get install -y curl devscripts equivs git + +ARG GO_VERSION +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 + +ARG COMMON_FILES +COPY ${COMMON_FILES} /root/build-deb/debian +RUN mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/build-deb/debian/control + +# Copy our sources and untar them +COPY sources/ /sources +RUN mkdir -p /go/src/github.com/docker/ && tar -xzf /sources/cli.tgz -C /go/src/github.com/docker/ +RUN mkdir -p /go/src/github.com/crosbymichael && tar -xzf /sources/containerd-proxy.tgz -C /go/src/github.com/crosbymichael + +RUN ln -snf /go/src/github.com/docker/cli /root/build-deb/cli + +ENV DISTRO debian +ENV SUITE stretch + +COPY --from=golang /usr/local/go /usr/local/go + +WORKDIR /root/build-deb +COPY build-deb /root/build-deb/build-deb + +ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/debian-stretch/Dockerfile.aarch64 b/components/packaging/deb/debian-stretch/Dockerfile.aarch64 deleted file mode 100644 index 4686b6d8d6..0000000000 --- a/components/packaging/deb/debian-stretch/Dockerfile.aarch64 +++ /dev/null @@ -1,32 +0,0 @@ -FROM arm64v8/debian:stretch - -# allow replacing httpredir or deb mirror -ARG APT_MIRROR=deb.debian.org -RUN sed -ri "s/(httpredir|deb).debian.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 gnupg dirmngr --no-install-recommends && rm -rf /var/lib/apt/lists/* - -ARG GO_VERSION -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-arm64.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 debian -ENV SUITE stretch - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/debian-stretch/Dockerfile.armv7l b/components/packaging/deb/debian-stretch/Dockerfile.armv7l deleted file mode 100644 index 0b048ee1ef..0000000000 --- a/components/packaging/deb/debian-stretch/Dockerfile.armv7l +++ /dev/null @@ -1,32 +0,0 @@ -FROM arm32v7/debian:stretch - -# allow replacing httpredir or deb mirror -ARG APT_MIRROR=deb.debian.org -RUN sed -ri "s/(httpredir|deb).debian.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/* - -ARG GO_VERSION -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 debian -ENV SUITE stretch - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/debian-stretch/Dockerfile.x86_64 b/components/packaging/deb/debian-stretch/Dockerfile.x86_64 deleted file mode 100644 index e6585eefd6..0000000000 --- a/components/packaging/deb/debian-stretch/Dockerfile.x86_64 +++ /dev/null @@ -1,32 +0,0 @@ -FROM debian:stretch - -# allow replacing httpredir or deb mirror -ARG APT_MIRROR=deb.debian.org -RUN sed -ri "s/(httpredir|deb).debian.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/* - -ARG GO_VERSION -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.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 debian -ENV SUITE stretch - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/raspbian-jessie/Dockerfile b/components/packaging/deb/raspbian-jessie/Dockerfile new file mode 100644 index 0000000000..15bf9a3ea4 --- /dev/null +++ b/components/packaging/deb/raspbian-jessie/Dockerfile @@ -0,0 +1,33 @@ +ARG GO_IMAGE +FROM ${GO_IMAGE} as golang + +FROM resin/rpi-raspbian:jessie + +RUN apt-get update && apt-get install -y curl devscripts equivs git + +ARG GO_VERSION +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 + +ARG COMMON_FILES +COPY ${COMMON_FILES} /root/build-deb/debian +RUN mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/build-deb/debian/control + +# Copy our sources and untar them +COPY sources/ /sources +RUN mkdir -p /go/src/github.com/docker/ && tar -xzf /sources/cli.tgz -C /go/src/github.com/docker/ +RUN mkdir -p /go/src/github.com/crosbymichael && tar -xzf /sources/containerd-proxy.tgz -C /go/src/github.com/crosbymichael + +RUN ln -snf /go/src/github.com/docker/cli /root/build-deb/cli + +ENV DISTRO raspbian +ENV SUITE jessie + +COPY --from=golang /usr/local/go /usr/local/go + +WORKDIR /root/build-deb +COPY build-deb /root/build-deb/build-deb + +ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/raspbian-jessie/Dockerfile.armv7l b/components/packaging/deb/raspbian-jessie/Dockerfile.armv7l deleted file mode 100644 index fbd8208399..0000000000 --- a/components/packaging/deb/raspbian-jessie/Dockerfile.armv7l +++ /dev/null @@ -1,33 +0,0 @@ -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 libudev-dev pkg-config vim-common libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* - -ARG GO_VERSION -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 b/components/packaging/deb/raspbian-stretch/Dockerfile new file mode 100644 index 0000000000..3b2cbe8800 --- /dev/null +++ b/components/packaging/deb/raspbian-stretch/Dockerfile @@ -0,0 +1,33 @@ +ARG GO_IMAGE +FROM ${GO_IMAGE} as golang + +FROM resin/rpi-raspbian:stretch + +RUN apt-get update && apt-get install -y curl devscripts equivs git + +ARG GO_VERSION +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 + +ARG COMMON_FILES +COPY ${COMMON_FILES} /root/build-deb/debian +RUN mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/build-deb/debian/control + +# Copy our sources and untar them +COPY sources/ /sources +RUN mkdir -p /go/src/github.com/docker/ && tar -xzf /sources/cli.tgz -C /go/src/github.com/docker/ +RUN mkdir -p /go/src/github.com/crosbymichael && tar -xzf /sources/containerd-proxy.tgz -C /go/src/github.com/crosbymichael + +RUN ln -snf /go/src/github.com/docker/cli /root/build-deb/cli + +ENV DISTRO raspbian +ENV SUITE stretch + +COPY --from=golang /usr/local/go /usr/local/go + +WORKDIR /root/build-deb +COPY build-deb /root/build-deb/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 deleted file mode 100644 index b075039b9f..0000000000 --- a/components/packaging/deb/raspbian-stretch/Dockerfile.armv7l +++ /dev/null @@ -1,33 +0,0 @@ -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/* - -ARG GO_VERSION -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"] diff --git a/components/packaging/deb/ubuntu-bionic/Dockerfile b/components/packaging/deb/ubuntu-bionic/Dockerfile new file mode 100644 index 0000000000..61dfde41c1 --- /dev/null +++ b/components/packaging/deb/ubuntu-bionic/Dockerfile @@ -0,0 +1,33 @@ +ARG GO_IMAGE +FROM ${GO_IMAGE} as golang + +FROM ubuntu:bionic + +RUN apt-get update && apt-get install -y curl devscripts equivs git + +ARG GO_VERSION +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 + +ARG COMMON_FILES +COPY ${COMMON_FILES} /root/build-deb/debian +RUN mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/build-deb/debian/control + +# Copy our sources and untar them +COPY sources/ /sources +RUN mkdir -p /go/src/github.com/docker/ && tar -xzf /sources/cli.tgz -C /go/src/github.com/docker/ +RUN mkdir -p /go/src/github.com/crosbymichael && tar -xzf /sources/containerd-proxy.tgz -C /go/src/github.com/crosbymichael + +RUN ln -snf /go/src/github.com/docker/cli /root/build-deb/cli + +ENV DISTRO ubuntu +ENV SUITE bionic + +COPY --from=golang /usr/local/go /usr/local/go + +WORKDIR /root/build-deb +COPY build-deb /root/build-deb/build-deb + +ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/ubuntu-bionic/Dockerfile.aarch64 b/components/packaging/deb/ubuntu-bionic/Dockerfile.aarch64 deleted file mode 100644 index 7d30697ef2..0000000000 --- a/components/packaging/deb/ubuntu-bionic/Dockerfile.aarch64 +++ /dev/null @@ -1,29 +0,0 @@ -FROM ubuntu:bionic - -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/* - -ARG GO_VERSION - -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-arm64.tar.gz" | tar xzC /usr/local -ENV GOPATH /go -ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin -ENV DOCKER_BUILDTAGS apparmor 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 ubuntu -ENV SUITE bionic - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/ubuntu-bionic/Dockerfile.armv7l b/components/packaging/deb/ubuntu-bionic/Dockerfile.armv7l deleted file mode 100644 index a005c88fc0..0000000000 --- a/components/packaging/deb/ubuntu-bionic/Dockerfile.armv7l +++ /dev/null @@ -1,28 +0,0 @@ -FROM ubuntu:bionic - -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/* - -ARG GO_VERSION -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 ubuntu -ENV SUITE bionic - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/ubuntu-bionic/Dockerfile.ppc64le b/components/packaging/deb/ubuntu-bionic/Dockerfile.ppc64le deleted file mode 100644 index 3c84844247..0000000000 --- a/components/packaging/deb/ubuntu-bionic/Dockerfile.ppc64le +++ /dev/null @@ -1,28 +0,0 @@ -FROM ubuntu:bionic - -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 pkg-config vim-common libseccomp-dev libsystemd-dev libltdl-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* - -ARG GO_VERSION -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.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 ubuntu -ENV SUITE bionic - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/ubuntu-bionic/Dockerfile.s390x b/components/packaging/deb/ubuntu-bionic/Dockerfile.s390x deleted file mode 100644 index 8a9ababfbc..0000000000 --- a/components/packaging/deb/ubuntu-bionic/Dockerfile.s390x +++ /dev/null @@ -1,28 +0,0 @@ -FROM ubuntu:bionic - -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/* - -ARG GO_VERSION -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-s390x.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 ubuntu -ENV SUITE bionic - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/ubuntu-bionic/Dockerfile.x86_64 b/components/packaging/deb/ubuntu-bionic/Dockerfile.x86_64 deleted file mode 100644 index c7ae56012e..0000000000 --- a/components/packaging/deb/ubuntu-bionic/Dockerfile.x86_64 +++ /dev/null @@ -1,28 +0,0 @@ -FROM ubuntu:bionic - -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/* - -ARG GO_VERSION -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.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 ubuntu -ENV SUITE bionic - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/ubuntu-trusty/Dockerfile b/components/packaging/deb/ubuntu-trusty/Dockerfile new file mode 100644 index 0000000000..b21b674dc9 --- /dev/null +++ b/components/packaging/deb/ubuntu-trusty/Dockerfile @@ -0,0 +1,33 @@ +ARG GO_IMAGE +FROM ${GO_IMAGE} as golang + +FROM ubuntu:trusty + +RUN apt-get update && apt-get install -y curl devscripts equivs git + +ARG GO_VERSION +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 + +ARG COMMON_FILES +COPY ${COMMON_FILES} /root/build-deb/debian +RUN mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/build-deb/debian/control + +# Copy our sources and untar them +COPY sources/ /sources +RUN mkdir -p /go/src/github.com/docker/ && tar -xzf /sources/cli.tgz -C /go/src/github.com/docker/ +RUN mkdir -p /go/src/github.com/crosbymichael && tar -xzf /sources/containerd-proxy.tgz -C /go/src/github.com/crosbymichael + +RUN ln -snf /go/src/github.com/docker/cli /root/build-deb/cli + +ENV DISTRO ubuntu +ENV SUITE trusty + +COPY --from=golang /usr/local/go /usr/local/go + +WORKDIR /root/build-deb +COPY build-deb /root/build-deb/build-deb + +ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/ubuntu-trusty/Dockerfile.armv7l b/components/packaging/deb/ubuntu-trusty/Dockerfile.armv7l deleted file mode 100644 index 98b6dabb20..0000000000 --- a/components/packaging/deb/ubuntu-trusty/Dockerfile.armv7l +++ /dev/null @@ -1,30 +0,0 @@ -FROM arm32v7/ubuntu:trusty - -# Temorary fix until ubuntu trusty package repositories are back up -RUN sed -i 's|security.ubuntu.com/ubuntu|ports.ubuntu.com/ubuntu-ports|' /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/* - -ARG GO_VERSION -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 ubuntu -ENV SUITE trusty - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/ubuntu-trusty/Dockerfile.x86_64 b/components/packaging/deb/ubuntu-trusty/Dockerfile.x86_64 deleted file mode 100644 index b155e964e0..0000000000 --- a/components/packaging/deb/ubuntu-trusty/Dockerfile.x86_64 +++ /dev/null @@ -1,28 +0,0 @@ -FROM ubuntu:trusty - -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/* - -ARG GO_VERSION -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.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 ubuntu -ENV SUITE trusty - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/ubuntu-xenial/Dockerfile b/components/packaging/deb/ubuntu-xenial/Dockerfile new file mode 100644 index 0000000000..f728407ca0 --- /dev/null +++ b/components/packaging/deb/ubuntu-xenial/Dockerfile @@ -0,0 +1,33 @@ +ARG GO_IMAGE +FROM ${GO_IMAGE} as golang + +FROM ubuntu:xenial + +RUN apt-get update && apt-get install -y curl devscripts equivs git + +ARG GO_VERSION +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 + +ARG COMMON_FILES +COPY ${COMMON_FILES} /root/build-deb/debian +RUN mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/build-deb/debian/control + +# Copy our sources and untar them +COPY sources/ /sources +RUN mkdir -p /go/src/github.com/docker/ && tar -xzf /sources/cli.tgz -C /go/src/github.com/docker/ +RUN mkdir -p /go/src/github.com/crosbymichael && tar -xzf /sources/containerd-proxy.tgz -C /go/src/github.com/crosbymichael + +RUN ln -snf /go/src/github.com/docker/cli /root/build-deb/cli + +ENV DISTRO ubuntu +ENV SUITE xenial + +COPY --from=golang /usr/local/go /usr/local/go + +WORKDIR /root/build-deb +COPY build-deb /root/build-deb/build-deb + +ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/ubuntu-xenial/Dockerfile.aarch64 b/components/packaging/deb/ubuntu-xenial/Dockerfile.aarch64 deleted file mode 100644 index 2b349ddd7d..0000000000 --- a/components/packaging/deb/ubuntu-xenial/Dockerfile.aarch64 +++ /dev/null @@ -1,29 +0,0 @@ -FROM arm64v8/ubuntu:xenial - -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/* - -ARG GO_VERSION - -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-arm64.tar.gz" | tar xzC /usr/local -ENV GOPATH /go -ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin -ENV DOCKER_BUILDTAGS apparmor 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 ubuntu -ENV SUITE xenial - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/ubuntu-xenial/Dockerfile.armv7l b/components/packaging/deb/ubuntu-xenial/Dockerfile.armv7l deleted file mode 100644 index 74861d7c44..0000000000 --- a/components/packaging/deb/ubuntu-xenial/Dockerfile.armv7l +++ /dev/null @@ -1,28 +0,0 @@ -FROM arm32v7/ubuntu:xenial - -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/* - -ARG GO_VERSION -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 ubuntu -ENV SUITE xenial - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/ubuntu-xenial/Dockerfile.ppc64le b/components/packaging/deb/ubuntu-xenial/Dockerfile.ppc64le deleted file mode 100644 index 99dffa363f..0000000000 --- a/components/packaging/deb/ubuntu-xenial/Dockerfile.ppc64le +++ /dev/null @@ -1,28 +0,0 @@ -FROM ppc64le/ubuntu:xenial - -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/* - -ARG GO_VERSION -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.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 ubuntu -ENV SUITE xenial - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/ubuntu-xenial/Dockerfile.s390x b/components/packaging/deb/ubuntu-xenial/Dockerfile.s390x deleted file mode 100644 index 85dccfc8b5..0000000000 --- a/components/packaging/deb/ubuntu-xenial/Dockerfile.s390x +++ /dev/null @@ -1,28 +0,0 @@ -FROM s390x/ubuntu:xenial - -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/* - -ARG GO_VERSION -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-s390x.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 ubuntu -ENV SUITE xenial - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/deb/ubuntu-xenial/Dockerfile.x86_64 b/components/packaging/deb/ubuntu-xenial/Dockerfile.x86_64 deleted file mode 100644 index 9e19d720e7..0000000000 --- a/components/packaging/deb/ubuntu-xenial/Dockerfile.x86_64 +++ /dev/null @@ -1,28 +0,0 @@ -FROM ubuntu:xenial - -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/* - -ARG GO_VERSION -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.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 ubuntu -ENV SUITE xenial - -WORKDIR /root/build-deb - -ENTRYPOINT ["/root/build-deb/build-deb"] diff --git a/components/packaging/image/Dockerfile b/components/packaging/image/Dockerfile.engine similarity index 81% rename from components/packaging/image/Dockerfile rename to components/packaging/image/Dockerfile.engine index 3c762ac86e..1da4d134e3 100644 --- a/components/packaging/image/Dockerfile +++ b/components/packaging/image/Dockerfile.engine @@ -51,14 +51,12 @@ RUN git clone https://github.com/opencontainers/runc.git /go/src/github.com/open WORKDIR /go/src/github.com/opencontainers/runc RUN source /binaries-commits && \ git checkout -q "$RUNC_COMMIT" && \ - make BUILDTAGS='seccomp apparmor' && make install + make BUILDTAGS='seccomp apparmor' static && make install # Final docker image -FROM alpine:3.7 -RUN apk --update add ca-certificates iptables net-tools libseccomp git && \ - rm -rf /var/cache/apk/* -COPY --from=dockerd-builder /sbin/dockerd /usr/local/sbin/ -COPY --from=proxy-builder /sbin/docker-proxy /usr/local/sbin/ -COPY --from=init-builder /sbin/docker-init /usr/local/sbin/ -COPY --from=runc-builder /usr/local/sbin/runc /usr/local/sbin/ -ENTRYPOINT ["/usr/local/sbin/dockerd"] +FROM scratch +COPY --from=dockerd-builder /sbin/dockerd /sbin/ +COPY --from=proxy-builder /sbin/docker-proxy /sbin/ +COPY --from=init-builder /sbin/docker-init /sbin/ +COPY --from=runc-builder /usr/local/sbin/runc /sbin/ +ENTRYPOINT ["/sbin/dockerd"] diff --git a/components/packaging/image/Makefile b/components/packaging/image/Makefile index eee5ce1aaf..49fb98721a 100644 --- a/components/packaging/image/Makefile +++ b/components/packaging/image/Makefile @@ -3,7 +3,8 @@ ENGINE_DIR:=$(CURDIR)/../../engine CLI_DIR:=$(CURDIR)/../../cli VERSION?=0.0.0-dev STATIC_VERSION=$(shell ../static/gen-static-ver $(ENGINE_DIR) $(VERSION)) -DOCKER_HUB_ORG?=docker +DOCKER_HUB_ORG?=dockereng +ARCH=$(shell uname -m) ENGINE_IMAGE?=engine-community .PHONY: help @@ -12,18 +13,29 @@ help: ## show make targets .PHONY: clean clean: ## remove build artifacts - docker rmi $(DOCKER_HUB_ORG)/$(ENGINE_IMAGE):$(STATIC_VERSION) + -docker rmi $(DOCKER_HUB_ORG)/$(ENGINE_IMAGE):$(STATIC_VERSION) + -rm -f image-linux .PHONY: image image: image-linux -.PHONY: image-linux -image-linux: - docker build -t $(DOCKER_HUB_ORG)/$(ENGINE_IMAGE):$(STATIC_VERSION) \ + +$(ENGINE_DIR)/Dockerfile.engine: + cp Dockerfile.engine $(ENGINE_DIR) + +# builds across multiple archs because the base images +# utilize manifests +image-linux: $(ENGINE_DIR)/Dockerfile.engine + docker build -t $(DOCKER_HUB_ORG)/$(ENGINE_IMAGE):$(STATIC_VERSION).$(ARCH) \ --build-arg VERSION=$(STATIC_VERSION) \ - --build-arg DOCKER_GITCOMMIT=$(cd $(ENGINE_DIR) && git rev-parse --short=7 HEAD) \ - --file ./Dockerfile $(ENGINE_DIR) + --build-arg DOCKER_GITCOMMIT=$$(cd $(ENGINE_DIR) && git rev-parse --short=7 HEAD) \ + --file $< $(ENGINE_DIR) + echo $(DOCKER_HUB_ORG)/$(ENGINE_IMAGE):$(STATIC_VERSION).$(ARCH) > $@ + +engine-$(ARCH).tar: image-linux + docker save -o $@ $$(cat $<) + .PHONY: release release: - docker push $(DOCKER_HUB_ORG)/$(ENGINE_IMAGE):$(STATIC_VERSION) + docker push $(DOCKER_HUB_ORG)/$(ENGINE_IMAGE):$(STATIC_VERSION).$(ARCH) diff --git a/components/packaging/rpm/Makefile b/components/packaging/rpm/Makefile index c0fe38599d..ee7dbbcbbf 100644 --- a/components/packaging/rpm/Makefile +++ b/components/packaging/rpm/Makefile @@ -1,26 +1,40 @@ +include ../containerd.mk + ARCH=$(shell uname -m) ENGINE_DIR:=$(CURDIR)/../../engine CLI_DIR:=$(CURDIR)/../../cli GITCOMMIT=$(shell cd $(ENGINE_DIR) && git rev-parse --short HEAD) VERSION?=0.0.0-dev +GO_BASE_IMAGE=golang GO_VERSION:=1.10.3 -GEN_RPM_VER=$(shell ./gen-rpm-ver $(ENGINE_DIR) $(VERSION)) -EPOCH?=2 +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 + +DOCKERFILE=Dockerfile +ifdef NEEDS_ARCH_SPECIFIC + DOCKERFILE=Dockerfile.$(ARCH) +endif +BUILD?=docker build --build-arg GO_IMAGE=$(GO_IMAGE) -t rpmbuild-$@/$(ARCH) -f $@/$(DOCKERFILE) . + +SPEC_FILES?=docker-ce.spec docker-ce-cli.spec +SPECS?=$(addprefix SPECS/, $(SPEC_FILES)) RPMBUILD=docker run --privileged --rm -i\ - -e EPOCH="$(EPOCH)" \ -v $(CURDIR)/rpmbuild/SOURCES:/root/rpmbuild/SOURCES \ - -v $(CURDIR)/rpmbuild/BUILD:/root/rpmbuild/BUILD \ - -v $(CURDIR)/rpmbuild/BUILDROOT:/root/rpmbuild/BUILDROOT \ -v $(CURDIR)/rpmbuild/RPMS:/root/rpmbuild/RPMS \ - -v $(CURDIR)/rpmbuild/SRPMS:/root/rpmbuild/SRPMS \ - -v $(CURDIR)/systemd:/systemd -RPMBUILD_FLAGS=-ba\ + -v $(CURDIR)/rpmbuild/SRPMS:/root/rpmbuild/SRPMS +RPMBUILD_FLAGS?=-ba\ --define '_gitcommit $(word 3,$(GEN_RPM_VER))' \ --define '_release $(word 2,$(GEN_RPM_VER))' \ --define '_version $(word 1,$(GEN_RPM_VER))' \ --define '_origversion $(word 4, $(GEN_RPM_VER))' \ - SPECS/docker-ce.spec + $(SPECS) +RUN?=$(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS) +ENGINE_IMAGE=docker/engine-community + +SOURCE_FILES=containerd-proxy.tgz cli.tgz containerd-shim-process.tar docker.service dockerd.json engine.tar +SOURCES=$(addprefix rpmbuild/SOURCES/, $(SOURCE_FILES)) + .PHONY: help help: ## show make targets @@ -29,7 +43,12 @@ help: ## show make targets .PHONY: clean clean: ## remove build artifacts [ ! -d rpmbuild ] || $(CHOWN) -R $(shell id -u):$(shell id -g) rpmbuild - rm -rf rpmbuild + $(RM) -r rpmbuild/ + [ ! -d artifacts ] || $(CHOWN) -R $(shell id -u):$(shell id -g) artifacts + $(RM) -r artifacts/ + [ ! -d tmp ] || $(CHOWN) -R $(shell id -u):$(shell id -g) tmp + $(RM) -r tmp/ + -docker rm docker2oci .PHONY: rpm rpm: fedora centos ## build all rpm packages @@ -41,21 +60,27 @@ fedora: fedora-28 fedora-27 fedora-26 ## build all fedora rpm packages centos: centos-7 ## build all centos rpm packages .PHONY: fedora-28 -fedora-28: rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz ## build fedora-28 rpm packages - docker build --build-arg GO_VERSION=$(GO_VERSION) -t rpmbuild-$@/$(ARCH) -f $@/Dockerfile.$(ARCH) $@ - $(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS) +fedora-28: ## build fedora-28 rpm packages +fedora-28: $(SOURCES) + $(CHOWN) -R root:root rpmbuild + $(BUILD) + $(RUN) $(CHOWN) -R $(shell id -u):$(shell id -g) rpmbuild .PHONY: fedora-27 -fedora-27: rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz ## build fedora-27 rpm packages - docker build --build-arg GO_VERSION=$(GO_VERSION) -t rpmbuild-$@/$(ARCH) -f $@/Dockerfile.$(ARCH) $@ - $(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS) +fedora-27: ## build fedora-27 rpm packages +fedora-27: $(SOURCES) + $(CHOWN) -R root:root rpmbuild + $(BUILD) + $(RUN) $(CHOWN) -R $(shell id -u):$(shell id -g) rpmbuild .PHONY: centos-7 -centos-7: rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz ## build centos-7 rpm packages - docker build --build-arg GO_VERSION=$(GO_VERSION) -t rpmbuild-$@/$(ARCH) -f $@/Dockerfile.$(ARCH) $@ - $(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS) +centos-7: ## build centos-7 rpm packages +centos-7: $(SOURCES) + $(CHOWN) -R root:root rpmbuild + $(BUILD) + $(RUN) $(CHOWN) -R $(shell id -u):$(shell id -g) rpmbuild rpmbuild/SOURCES/cli.tgz: @@ -66,10 +91,46 @@ rpmbuild/SOURCES/cli.tgz: alpine \ tar -C / -c -z -f /v/cli.tgz --exclude .git cli -rpmbuild/SOURCES/engine.tgz: - mkdir -p rpmbuild/SOURCES - docker run --rm -i -w /v \ - -v $(ENGINE_DIR):/engine \ - -v $(CURDIR)/rpmbuild/SOURCES:/v \ - alpine \ - tar -C / -c -z -f /v/engine.tgz --exclude .git engine +rpmbuild/SOURCES/containerd-proxy.tgz: + mkdir -p tmp/ + curl -fL -o tmp/containerd-proxy.tgz "https://github.com/crosbymichael/containerd-proxy/archive/$(CONTAINERD_PROXY_COMMIT).tar.gz" + tar xzf tmp/containerd-proxy.tgz -C tmp/ + mv tmp/containerd-proxy-$(CONTAINERD_PROXY_COMMIT) tmp/containerd-proxy + mkdir -p $(@D) + $(CHOWN) -R $(shell id -u):$(shell id -g) rpmbuild + tar -zcf $@ -C tmp/ containerd-proxy + rm -rf tmp/ + +rpmbuild/SOURCES/containerd-shim-process.tar: + $(CTR) content fetch $(CONTAINERD_SHIM_PROCESS_IMAGE) + $(CTR) image export artifacts/containerd-shim-process.tar $(CONTAINERD_SHIM_PROCESS_IMAGE) + mkdir -p $(@D) + cp artifacts/containerd-shim-process.tar $@ + $(CHOWN) -R $(shell id -u):$(shell id -g) rpmbuild + +rpmbuild/SOURCES/docker.service: ../systemd/docker.service + mkdir -p $(@D) + cp $< $@ + +rpmbuild/SOURCES/dockerd.json: ../common/dockerd.json + mkdir -p $(@D) + sed -e 's!$${ENGINE_IMAGE}!$(ENGINE_IMAGE)!' -e 's/$${IMAGE_TAG}/$(IMAGE_TAG)/' $< > $@ + +# TODO: Eventually clean this up when we release an image with a manifest +DOCKER2OCI=artifacts/docker2oci +$(DOCKER2OCI): + -$(CHOWN) -R $(shell id -u):$(shell id -g) $(@D) + docker run --name docker2oci $(GO_IMAGE) sh -c 'go get github.com/coolljt0725/docker2oci' + mkdir -p $(@D) + docker cp docker2oci:/go/bin/docker2oci "$@" + docker rm -f docker2oci + $(CHOWN) -R $(shell id -u):$(shell id -g) $(@D) + +# offline bundle +rpmbuild/SOURCES/engine.tar: $(DOCKER2OCI) + $(MAKE) -C ../image ENGINE_IMAGE=$(ENGINE_IMAGE) image-linux + mkdir -p artifacts + docker save -o artifacts/docker-engine.tar $$(cat ../image/image-linux) + ./$(DOCKER2OCI) -i artifacts/docker-engine.tar artifacts/engine-image + mkdir -p $(@D) + tar c -C artifacts/engine-image . > $@ diff --git a/components/packaging/rpm/SPECS/docker-ce-cli.spec b/components/packaging/rpm/SPECS/docker-ce-cli.spec new file mode 100644 index 0000000000..0dea3d3ed2 --- /dev/null +++ b/components/packaging/rpm/SPECS/docker-ce-cli.spec @@ -0,0 +1,103 @@ +%global debug_package %{nil} + +Name: docker-ce-cli +Version: %{_version} +Release: %{_release}%{?dist} +Epoch: 0 +Summary: The open-source application container engine +Group: Tools/Docker +License: ASL 2.0 +Source0: cli.tgz +URL: https://www.docker.com +Vendor: Docker +Packager: Docker + +# required packages on install +Requires: /bin/sh +Requires: containerd + +BuildRequires: make +BuildRequires: libtool-ltdl-devel + +# conflicting packages +Conflicts: docker +Conflicts: docker-io +Conflicts: docker-engine-cs +Conflicts: docker-ee +Conflicts: docker-ee-cli + +# Obsolete packages +Obsoletes: docker-ce-selinux +Obsoletes: docker-engine-selinux +Obsoletes: docker-engine + +%description +Docker is an open source project to build, ship and run any application as a +lightweight container. + +Docker containers are both hardware-agnostic and platform-agnostic. This means +they can run anywhere, from your laptop to the largest EC2 compute instance and +everything in between - and they don't require you to use a particular +language, framework or packaging system. That makes them great building blocks +for deploying and scaling web apps, databases, and backend services without +depending on a particular stack or provider. + +%prep +%setup -q -c -n src + +%build +mkdir -p /go/src/github.com/docker +rm -f /go/src/github.com/docker/cli +ln -s /root/rpmbuild/BUILD/src/cli /go/src/github.com/docker/cli +pushd /go/src/github.com/docker/cli +DISABLE_WARN_OUTSIDE_CONTAINER=1 make VERSION=%{_origversion} GITCOMMIT=%{_gitcommit} dynbinary manpages # cli +popd + +# %check +# cli/build/docker -v + +%install +# install binary +install -d $RPM_BUILD_ROOT/%{_bindir} +install -p -m 755 cli/build/docker $RPM_BUILD_ROOT/%{_bindir}/docker + +# add bash, zsh, and fish completions +install -d $RPM_BUILD_ROOT/usr/share/bash-completion/completions +install -d $RPM_BUILD_ROOT/usr/share/zsh/vendor-completions +install -d $RPM_BUILD_ROOT/usr/share/fish/vendor_completions.d +install -p -m 644 cli/contrib/completion/bash/docker $RPM_BUILD_ROOT/usr/share/bash-completion/completions/docker +install -p -m 644 cli/contrib/completion/zsh/_docker $RPM_BUILD_ROOT/usr/share/zsh/vendor-completions/_docker +install -p -m 644 cli/contrib/completion/fish/docker.fish $RPM_BUILD_ROOT/usr/share/fish/vendor_completions.d/docker.fish + +# install manpages +install -d %{buildroot}%{_mandir}/man1 +install -p -m 644 cli/man/man1/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1 +install -d %{buildroot}%{_mandir}/man5 +install -p -m 644 cli/man/man5/*.5 $RPM_BUILD_ROOT/%{_mandir}/man5 +install -d %{buildroot}%{_mandir}/man8 +install -p -m 644 cli/man/man8/*.8 $RPM_BUILD_ROOT/%{_mandir}/man8 + +mkdir -p build-docs +for cli_file in LICENSE MAINTAINERS NOTICE README.md; do + cp "cli/$cli_file" "build-docs/$cli_file" +done + +# list files owned by the package here +%files +%doc build-docs/LICENSE build-docs/MAINTAINERS build-docs/NOTICE build-docs/README.md +/%{_bindir}/docker +/usr/share/bash-completion/completions/docker +/usr/share/zsh/vendor-completions/_docker +/usr/share/fish/vendor_completions.d/docker.fish +%doc +/%{_mandir}/man1/* +/%{_mandir}/man5/* +/%{_mandir}/man8/* + + +%post +if ! getent group docker > /dev/null; then + groupadd --system docker +fi + +%changelog diff --git a/components/packaging/rpm/SPECS/docker-ce.spec b/components/packaging/rpm/SPECS/docker-ce.spec new file mode 100644 index 0000000000..96693ccaf4 --- /dev/null +++ b/components/packaging/rpm/SPECS/docker-ce.spec @@ -0,0 +1,115 @@ +%global debug_package %{nil} + +Name: docker-ce +Version: %{_version} +Release: %{_release}%{?dist} +Epoch: 2 +Source0: containerd-proxy.tgz +Source1: containerd-shim-process.tar +Source2: docker.service +Source3: engine.tar +Summary: The open-source application container engine +Group: Tools/Docker +License: ASL 2.0 +URL: https://www.docker.com +Vendor: Docker +Packager: Docker + +Requires: docker-ce-cli +Requires: systemd-units +Requires: iptables +# Should be required as well by docker-ce-cli but let's just be thorough +Requires: containerd.io + +BuildRequires: which +BuildRequires: make +BuildRequires: gcc +BuildRequires: pkgconfig(systemd) + +# conflicting packages +Conflicts: docker +Conflicts: docker-io +Conflicts: docker-engine-cs +Conflicts: docker-ee + +# Obsolete packages +Obsoletes: docker-ce-selinux +Obsoletes: docker-engine-selinux +Obsoletes: docker-engine + +%description +Docker is an open source project to build, ship and run any application as a +lightweight container. + +Docker containers are both hardware-agnostic and platform-agnostic. This means +they can run anywhere, from your laptop to the largest EC2 compute instance and +everything in between - and they don't require you to use a particular +language, framework or packaging system. That makes them great building blocks +for deploying and scaling web apps, databases, and backend services without +depending on a particular stack or provider. + +%prep +%setup -q -c -n src + +%build +# dockerd proxy compilation +mkdir -p /go/src/github.com/crosbymichael/ +ls %{_topdir}/BUILD/src +ln -s %{_topdir}/BUILD/src/containerd-proxy /go/src/github.com/crosbymichael/containerd-proxy +pushd /go/src/github.com/crosbymichael/containerd-proxy +make SCOPE_LABEL="com.docker/containerd-proxy.scope" ANY_SCOPE="ee" bin/containerd-proxy +popd + +%install +# Install containerd-proxy as dockerd +install -D -m 0755 %{_topdir}/BUILD/src/containerd-proxy/bin/containerd-proxy $RPM_BUILD_ROOT/%{_bindir}/dockerd +install -D -m 0644 %{_topdir}/SOURCES/containerd-shim-process.tar $RPM_BUILD_ROOT/%{_sharedstatedir}/containerd-offline-installer/containerd-shim-process.tar +install -D -m 0644 %{_topdir}/SOURCES/engine.tar $RPM_BUILD_ROOT/%{_sharedstatedir}/docker-engine/engine.tar +install -D -m 0644 %{_topdir}/SOURCES/docker.service $RPM_BUILD_ROOT/%{_unitdir}/docker.service +install -D -m 0644 %{_topdir}/SOURCES/dockerd.json $RPM_BUILD_ROOT/etc/containerd-proxy/dockerd.json + +%files +/%{_bindir}/dockerd +/%{_sharedstatedir}/containerd-offline-installer/containerd-shim-process.tar +/%{_sharedstatedir}/docker-engine/engine.tar +/%{_unitdir}/docker.service +/etc/containerd-proxy/dockerd.json + +%pre +if [ $1 -gt 0 ] ; then + # package upgrade scenario, before new files are installed + + # clear any old state + rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : + + # check if docker service is running + if systemctl is-active docker > /dev/null 2>&1; then + systemctl stop docker > /dev/null 2>&1 || : + touch %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : + fi +fi + +%post +%systemd_post docker +if ! getent group docker > /dev/null; then + groupadd --system docker +fi + +%preun +%systemd_preun docker + +%postun +%systemd_postun_with_restart docker + +%posttrans +if [ $1 -ge 0 ] ; then + # package upgrade scenario, after new files are installed + + # check if docker was running before upgrade + if [ -f %{_localstatedir}/lib/rpm-state/docker-is-active ]; then + systemctl start docker > /dev/null 2>&1 || : + rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || : + fi +fi + +%changelog diff --git a/components/packaging/rpm/centos-7/Dockerfile b/components/packaging/rpm/centos-7/Dockerfile new file mode 100644 index 0000000000..6d5c01d55b --- /dev/null +++ b/components/packaging/rpm/centos-7/Dockerfile @@ -0,0 +1,19 @@ +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 +# 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 +ENTRYPOINT ["/bin/rpmbuild"] diff --git a/components/packaging/rpm/centos-7/Dockerfile.aarch64 b/components/packaging/rpm/centos-7/Dockerfile.aarch64 deleted file mode 100644 index 53517be33f..0000000000 --- a/components/packaging/rpm/centos-7/Dockerfile.aarch64 +++ /dev/null @@ -1,33 +0,0 @@ -FROM arm64v8/centos:7 -RUN yum groupinstall -y "Development Tools" -RUN yum -y swap -- remove systemd-container systemd-container-libs -- install systemd systemd-libs -RUN yum install -y \ - glibc-static \ - btrfs-progs-devel \ - device-mapper-devel \ - libseccomp-devel \ - libselinux-devel \ - libtool-ltdl-devel \ - selinux-policy-devel \ - systemd-devel \ - pkgconfig \ - tar \ - git \ - cmake \ - rpmdevtools \ - vim-common - -ARG GO_VERSION -ENV DISTRO centos -ENV SUITE 7 -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-arm64.tar.gz" | tar xzC /usr/local -RUN mkdir -p /go -ENV GOPATH=/go -ENV PATH $PATH:/usr/local/go/bin:/go/bin -ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS pkcs11 seccomp selinux -ENV RUNC_BUILDTAGS seccomp selinux -RUN mkdir -p /go/src/github.com/docker && mkdir -p /go/src/github.com/opencontainers -COPY docker-ce.spec /root/rpmbuild/SPECS/docker-ce.spec -WORKDIR /root/rpmbuild -ENTRYPOINT ["/bin/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 7cdc495480..0000000000 --- a/components/packaging/rpm/centos-7/Dockerfile.x86_64 +++ /dev/null @@ -1,33 +0,0 @@ -FROM centos:7 -RUN yum groupinstall -y "Development Tools" -RUN yum -y swap -- remove systemd-container systemd-container-libs -- install systemd systemd-libs -RUN yum install -y \ - glibc-static \ - btrfs-progs-devel \ - device-mapper-devel \ - libseccomp-devel \ - libselinux-devel \ - libtool-ltdl-devel \ - selinux-policy-devel \ - systemd-devel \ - pkgconfig \ - tar \ - git \ - cmake \ - rpmdevtools \ - vim-common - -ARG GO_VERSION -ENV DISTRO centos -ENV SUITE 7 -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local -RUN mkdir -p /go -ENV GOPATH=/go -ENV PATH $PATH:/usr/local/go/bin:/go/bin -ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS pkcs11 seccomp selinux -ENV RUNC_BUILDTAGS seccomp selinux -RUN mkdir -p /go/src/github.com/docker && mkdir -p /go/src/github.com/opencontainers -COPY docker-ce.spec /root/rpmbuild/SPECS/docker-ce.spec -WORKDIR /root/rpmbuild -ENTRYPOINT ["/bin/rpmbuild"] diff --git a/components/packaging/rpm/centos-7/docker-ce.spec b/components/packaging/rpm/centos-7/docker-ce.spec index 41318c4af9..f20f7cb614 100644 --- a/components/packaging/rpm/centos-7/docker-ce.spec +++ b/components/packaging/rpm/centos-7/docker-ce.spec @@ -1,7 +1,7 @@ Name: docker-ce Version: %{_version} Release: %{_release}%{?dist} -Epoch: %{getenv:EPOCH} +Epoch: 2 Summary: The open-source application container engine Group: Tools/Docker License: ASL 2.0 @@ -17,6 +17,15 @@ Packager: Docker %global is_systemd 1 %global with_selinux 1 +BuildRequires: make +BuildRequires: cmake +BuildRequires: gcc +BuildRequires: git +BuildRequires: glibc-static +BuildRequires: libtool-ltdl-devel +BuildRequires: libseccomp-devel +BuildRequires: device-mapper-devel +BuildRequires: btrfs-progs-devel BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(libsystemd-journal) @@ -64,7 +73,7 @@ mkdir -p /go/src/github.com/docker rm -f /go/src/github.com/docker/cli ln -s /root/rpmbuild/BUILD/src/cli /go/src/github.com/docker/cli pushd /go/src/github.com/docker/cli -make VERSION=%{_origversion} GITCOMMIT=%{_gitcommit} dynbinary manpages # cli +DISABLE_WARN_OUTSIDE_CONTAINER=1 make VERSION=%{_origversion} GITCOMMIT=%{_gitcommit} dynbinary manpages # cli popd pushd engine for component in tini "proxy dynamic" "runc all" "containerd dynamic";do diff --git a/components/packaging/rpm/fedora-27/Dockerfile b/components/packaging/rpm/fedora-27/Dockerfile new file mode 100644 index 0000000000..ee2f8b0860 --- /dev/null +++ b/components/packaging/rpm/fedora-27/Dockerfile @@ -0,0 +1,17 @@ +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-27/Dockerfile.aarch64 b/components/packaging/rpm/fedora-27/Dockerfile.aarch64 deleted file mode 100644 index c62395c725..0000000000 --- a/components/packaging/rpm/fedora-27/Dockerfile.aarch64 +++ /dev/null @@ -1,17 +0,0 @@ -FROM arm64v8/fedora:27 -RUN dnf -y upgrade -RUN dnf install -y @development-tools fedora-packager -RUN dnf install -y btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel systemd-devel tar git cmake vim-common -ARG GO_VERSION -ENV DISTRO fedora -ENV SUITE 27 -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-arm64.tar.gz" | tar xzC /usr/local -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 mkdir -p /go/src/github.com/docker && mkdir -p /go/src/github.com/opencontainers -COPY docker-ce.spec /root/rpmbuild/SPECS/docker-ce.spec -WORKDIR /root/rpmbuild -ENTRYPOINT ["/bin/rpmbuild"] 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 f55cadba5d..0000000000 --- a/components/packaging/rpm/fedora-27/Dockerfile.x86_64 +++ /dev/null @@ -1,17 +0,0 @@ -FROM fedora:27 -RUN dnf -y upgrade -RUN dnf install -y @development-tools fedora-packager -RUN dnf install -y btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel systemd-devel tar git cmake vim-common -ARG GO_VERSION -ENV DISTRO fedora -ENV SUITE 27 -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local -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 mkdir -p /go/src/github.com/docker && mkdir -p /go/src/github.com/opencontainers -COPY docker-ce.spec /root/rpmbuild/SPECS/docker-ce.spec -WORKDIR /root/rpmbuild -ENTRYPOINT ["/bin/rpmbuild"] diff --git a/components/packaging/rpm/fedora-27/docker-ce.spec b/components/packaging/rpm/fedora-27/docker-ce.spec index cc13455dd1..cc3f724fc4 100644 --- a/components/packaging/rpm/fedora-27/docker-ce.spec +++ b/components/packaging/rpm/fedora-27/docker-ce.spec @@ -1,7 +1,7 @@ Name: docker-ce Version: %{_version} Release: %{_release}%{?dist} -Epoch: %{getenv:EPOCH} +Epoch: 2 Summary: The open-source application container engine Group: Tools/Docker License: ASL 2.0 @@ -18,6 +18,15 @@ Packager: Docker %global with_selinux 1 %global _missing_build_ids_terminate_build 0 +BuildRequires: make +BuildRequires: cmake +BuildRequires: gcc +BuildRequires: git +BuildRequires: glibc-static +BuildRequires: libtool-ltdl-devel +BuildRequires: libseccomp-devel +BuildRequires: device-mapper-devel +BuildRequires: btrfs-progs-devel BuildRequires: pkgconfig(systemd) # required packages on install @@ -64,7 +73,7 @@ mkdir -p /go/src/github.com/docker rm -f /go/src/github.com/docker/cli ln -s /root/rpmbuild/BUILD/src/cli /go/src/github.com/docker/cli pushd /go/src/github.com/docker/cli -make VERSION=%{_origversion} GITCOMMIT=%{_gitcommit} dynbinary manpages # cli +DISABLE_WARN_OUTSIDE_CONTAINER=1 make VERSION=%{_origversion} GITCOMMIT=%{_gitcommit} dynbinary manpages # cli popd pushd engine for component in tini "proxy dynamic" "runc all" "containerd dynamic";do diff --git a/components/packaging/rpm/fedora-28/Dockerfile b/components/packaging/rpm/fedora-28/Dockerfile new file mode 100644 index 0000000000..da23b74991 --- /dev/null +++ b/components/packaging/rpm/fedora-28/Dockerfile @@ -0,0 +1,16 @@ +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 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.aarch64 b/components/packaging/rpm/fedora-28/Dockerfile.aarch64 deleted file mode 100644 index f8f68512f4..0000000000 --- a/components/packaging/rpm/fedora-28/Dockerfile.aarch64 +++ /dev/null @@ -1,17 +0,0 @@ -FROM fedora:28 -RUN dnf -y upgrade -RUN dnf install -y @development-tools fedora-packager -RUN dnf install -y btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel systemd-devel tar git cmake vim-common -ARG GO_VERSION -ENV DISTRO fedora -ENV SUITE 28 -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-arm64.tar.gz" | tar xzC /usr/local -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 mkdir -p /go/src/github.com/docker && mkdir -p /go/src/github.com/opencontainers -COPY docker-ce.spec /root/rpmbuild/SPECS/docker-ce.spec -WORKDIR /root/rpmbuild -ENTRYPOINT ["/bin/rpmbuild"] diff --git a/components/packaging/rpm/fedora-28/Dockerfile.x86_64 b/components/packaging/rpm/fedora-28/Dockerfile.x86_64 deleted file mode 100644 index b5db207950..0000000000 --- a/components/packaging/rpm/fedora-28/Dockerfile.x86_64 +++ /dev/null @@ -1,17 +0,0 @@ -FROM fedora:28 -RUN dnf -y upgrade -RUN dnf install -y @development-tools fedora-packager -RUN dnf install -y btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel pkgconfig selinux-policy selinux-policy-devel systemd-devel tar git cmake vim-common -ARG GO_VERSION -ENV DISTRO fedora -ENV SUITE 28 -RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local -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 mkdir -p /go/src/github.com/docker && mkdir -p /go/src/github.com/opencontainers -COPY docker-ce.spec /root/rpmbuild/SPECS/docker-ce.spec -WORKDIR /root/rpmbuild -ENTRYPOINT ["/bin/rpmbuild"] diff --git a/components/packaging/rpm/fedora-28/docker-ce.spec b/components/packaging/rpm/fedora-28/docker-ce.spec index cc13455dd1..cc3f724fc4 100644 --- a/components/packaging/rpm/fedora-28/docker-ce.spec +++ b/components/packaging/rpm/fedora-28/docker-ce.spec @@ -1,7 +1,7 @@ Name: docker-ce Version: %{_version} Release: %{_release}%{?dist} -Epoch: %{getenv:EPOCH} +Epoch: 2 Summary: The open-source application container engine Group: Tools/Docker License: ASL 2.0 @@ -18,6 +18,15 @@ Packager: Docker %global with_selinux 1 %global _missing_build_ids_terminate_build 0 +BuildRequires: make +BuildRequires: cmake +BuildRequires: gcc +BuildRequires: git +BuildRequires: glibc-static +BuildRequires: libtool-ltdl-devel +BuildRequires: libseccomp-devel +BuildRequires: device-mapper-devel +BuildRequires: btrfs-progs-devel BuildRequires: pkgconfig(systemd) # required packages on install @@ -64,7 +73,7 @@ mkdir -p /go/src/github.com/docker rm -f /go/src/github.com/docker/cli ln -s /root/rpmbuild/BUILD/src/cli /go/src/github.com/docker/cli pushd /go/src/github.com/docker/cli -make VERSION=%{_origversion} GITCOMMIT=%{_gitcommit} dynbinary manpages # cli +DISABLE_WARN_OUTSIDE_CONTAINER=1 make VERSION=%{_origversion} GITCOMMIT=%{_gitcommit} dynbinary manpages # cli popd pushd engine for component in tini "proxy dynamic" "runc all" "containerd dynamic";do diff --git a/components/packaging/rpm/systemd/docker.service b/components/packaging/rpm/systemd/docker.service deleted file mode 100644 index 6c60646b56..0000000000 --- a/components/packaging/rpm/systemd/docker.service +++ /dev/null @@ -1,33 +0,0 @@ -[Unit] -Description=Docker Application Container Engine -Documentation=https://docs.docker.com -After=network-online.target firewalld.service -Wants=network-online.target - -[Service] -Type=notify -# the default is not to use systemd for cgroups because the delegate issues still -# exists and systemd currently does not support the cgroup feature set required -# for containers run by docker -ExecStart=/usr/bin/dockerd -ExecReload=/bin/kill -s HUP $MAINPID -# Having non-zero Limit*s causes performance problems due to accounting overhead -# in the kernel. We recommend using cgroups to do container-local accounting. -LimitNOFILE=infinity -LimitNPROC=infinity -LimitCORE=infinity -# Uncomment TasksMax if your systemd version supports it. -# Only systemd 226 and above support this version. -#TasksMax=infinity -TimeoutStartSec=0 -# set delegate yes so that systemd does not reset the cgroups of docker containers -Delegate=yes -# kill only the docker process, not all processes in the cgroup -KillMode=process -# restart the docker process if it exits prematurely -Restart=on-failure -StartLimitBurst=3 -StartLimitInterval=60s - -[Install] -WantedBy=multi-user.target diff --git a/components/packaging/systemd/docker.service b/components/packaging/systemd/docker.service new file mode 100644 index 0000000000..4322dce30e --- /dev/null +++ b/components/packaging/systemd/docker.service @@ -0,0 +1,19 @@ +[Unit] +Description=Docker Application Container Engine +Documentation=https://docs.docker.com +BindsTo=containerd.service +After=network-online.target firewalld.service +Wants=network-online.target + +[Service] +# Install containerd-shim-process if it's not already installed +ExecStartPre=/usr/libexec/containerd-offline-installer /var/lib/containerd-offline-installer/containerd-shim-process.tar docker.io/docker/containerd-shim-process +ExecStart=/usr/bin/dockerd +TimeoutSec=0 +Restart=always +# On RPM Based distributions PATH isn't defined so we define it here +# /opt/containerd/bin is in front so dockerd grabs the correct runc binary +Environment="PATH=/opt/containerd/bin:/sbin:/usr/bin:/usr/local/bin:$PATH" + +[Install] +WantedBy=multi-user.target