From 98180b89543396c07c1f1ea420554fbcce31c513 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 29 May 2015 12:55:58 -0700 Subject: [PATCH] Finally add precise/12.04 as a build-deb target Ubuntu Precise has a number of warts that made it non-trivial to add initially, but I've managed to work through some of them and come up with a working build. Two important parts to note are that it has neither the `btrfs` nor the `devicemapper` graphdriver backends since `btrfs-tools` and `libdevmapper-dev` in the precise repositories are too ancient for them to even compile. Signed-off-by: Andrew "Tianon" Page --- contrib/builder/deb/generate.sh | 21 ++++++++++++++++++- .../deb/ubuntu-debootstrap-precise/Dockerfile | 14 +++++++++++++ hack/make/.build-deb/rules | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 contrib/builder/deb/ubuntu-debootstrap-precise/Dockerfile diff --git a/contrib/builder/deb/generate.sh b/contrib/builder/deb/generate.sh index 49b26c45f4..4bb7320eaf 100755 --- a/contrib/builder/deb/generate.sh +++ b/contrib/builder/deb/generate.sh @@ -41,6 +41,8 @@ for version in "${versions[@]}"; do echo >> "$version/Dockerfile" + extraBuildTags= + # this list is sorted alphabetically; please keep it that way packages=( bash-completion # for bash-completion debhelper integration @@ -54,6 +56,23 @@ for version in "${versions[@]}"; do libdevmapper-dev # for "libdevmapper.h" libsqlite3-dev # for "sqlite3.h" ) + + if [ "$suite" = 'precise' ]; then + # precise has a few package issues + + # - dh-systemd doesn't exist at all + packages=( "${packages[@]/dh-systemd}" ) + + # - libdevmapper-dev is missing critical structs (too old) + packages=( "${packages[@]/libdevmapper-dev}" ) + extraBuildTags+=' exclude_graphdriver_devicemapper' + + # - btrfs-tools is missing "ioctl.h" (too old), so it's useless + # (since kernels on precise are old too, just skip btrfs entirely) + packages=( "${packages[@]/btrfs-tools}" ) + extraBuildTags+=' exclude_graphdriver_btrfs' + fi + echo "RUN apt-get update && apt-get install -y ${packages[*]} --no-install-recommends && rm -rf /var/lib/apt/lists/*" >> "$version/Dockerfile" echo >> "$version/Dockerfile" @@ -65,5 +84,5 @@ for version in "${versions[@]}"; do echo >> "$version/Dockerfile" echo 'ENV AUTO_GOPATH 1' >> "$version/Dockerfile" - awk '$1 == "ENV" && $2 == "DOCKER_BUILDTAGS" { print; exit }' ../../../Dockerfile >> "$version/Dockerfile" + awk '$1 == "ENV" && $2 == "DOCKER_BUILDTAGS" { print $0 "'"$extraBuildTags"'"; exit }' ../../../Dockerfile >> "$version/Dockerfile" done diff --git a/contrib/builder/deb/ubuntu-debootstrap-precise/Dockerfile b/contrib/builder/deb/ubuntu-debootstrap-precise/Dockerfile new file mode 100644 index 0000000000..ae6f464783 --- /dev/null +++ b/contrib/builder/deb/ubuntu-debootstrap-precise/Dockerfile @@ -0,0 +1,14 @@ +# +# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"! +# + +FROM ubuntu-debootstrap:precise + +RUN apt-get update && apt-get install -y bash-completion build-essential curl ca-certificates debhelper git libapparmor-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* + +ENV GO_VERSION 1.4.2 +RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local +ENV PATH $PATH:/usr/local/go/bin + +ENV AUTO_GOPATH 1 +ENV DOCKER_BUILDTAGS apparmor selinux exclude_graphdriver_devicemapper exclude_graphdriver_btrfs diff --git a/hack/make/.build-deb/rules b/hack/make/.build-deb/rules index fe19b729ea..795af471d9 100755 --- a/hack/make/.build-deb/rules +++ b/hack/make/.build-deb/rules @@ -33,4 +33,4 @@ override_dh_installudev: dh_installudev --priority=z80 %: - dh $@ --with=systemd,bash-completion + dh $@ --with=bash-completion $(shell command -v dh_systemd_enable > /dev/null 2>&1 && echo --with=systemd)