This PR adds the ability to make docker debs for xenial on power
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
| 0 | 10 |
new file mode 100755 |
| ... | ... |
@@ -0,0 +1,100 @@ |
| 0 |
+#!/bin/bash |
|
| 1 |
+set -e |
|
| 2 |
+ |
|
| 3 |
+# This file is used to auto-generate Dockerfiles for making debs via 'make deb' |
|
| 4 |
+# |
|
| 5 |
+# usage: ./generate.sh [versions] |
|
| 6 |
+# ie: ./generate.sh |
|
| 7 |
+# to update all Dockerfiles in this directory |
|
| 8 |
+# or: ./generate.sh ubuntu-xenial |
|
| 9 |
+# to only update ubuntu-xenial/Dockerfile |
|
| 10 |
+# or: ./generate.sh ubuntu-newversion |
|
| 11 |
+# to create a new folder and a Dockerfile within it |
|
| 12 |
+ |
|
| 13 |
+cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" |
|
| 14 |
+ |
|
| 15 |
+versions=( "$@" ) |
|
| 16 |
+if [ ${#versions[@]} -eq 0 ]; then
|
|
| 17 |
+ versions=( */ ) |
|
| 18 |
+fi |
|
| 19 |
+versions=( "${versions[@]%/}" )
|
|
| 20 |
+ |
|
| 21 |
+for version in "${versions[@]}"; do
|
|
| 22 |
+ echo "${versions[@]}"
|
|
| 23 |
+ distro="${version%-*}"
|
|
| 24 |
+ suite="${version##*-}"
|
|
| 25 |
+ from="ppc64le/${distro}:${suite}"
|
|
| 26 |
+ |
|
| 27 |
+ mkdir -p "$version" |
|
| 28 |
+ echo "$version -> FROM $from" |
|
| 29 |
+ cat > "$version/Dockerfile" <<-EOF |
|
| 30 |
+ # |
|
| 31 |
+ # THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/ppc64le/generate.sh"! |
|
| 32 |
+ # |
|
| 33 |
+ |
|
| 34 |
+ FROM $from |
|
| 35 |
+ |
|
| 36 |
+ EOF |
|
| 37 |
+ |
|
| 38 |
+ extraBuildTags='pkcs11' |
|
| 39 |
+ runcBuildTags= |
|
| 40 |
+ |
|
| 41 |
+ # this list is sorted alphabetically; please keep it that way |
|
| 42 |
+ packages=( |
|
| 43 |
+ apparmor # for apparmor_parser for testing the profile |
|
| 44 |
+ bash-completion # for bash-completion debhelper integration |
|
| 45 |
+ btrfs-tools # for "btrfs/ioctl.h" (and "version.h" if possible) |
|
| 46 |
+ build-essential # "essential for building Debian packages" |
|
| 47 |
+ curl ca-certificates # for downloading Go |
|
| 48 |
+ debhelper # for easy ".deb" building |
|
| 49 |
+ dh-apparmor # for apparmor debhelper |
|
| 50 |
+ dh-systemd # for systemd debhelper integration |
|
| 51 |
+ git # for "git commit" info in "docker -v" |
|
| 52 |
+ golang-go # ppc64le needs go to bootstrap go |
|
| 53 |
+ libapparmor-dev # for "sys/apparmor.h" |
|
| 54 |
+ libdevmapper-dev # for "libdevmapper.h" |
|
| 55 |
+ libltdl-dev # for pkcs11 "ltdl.h" |
|
| 56 |
+ libseccomp-dev # for "seccomp.h" & "libseccomp.so" |
|
| 57 |
+ libsqlite3-dev # for "sqlite3.h" |
|
| 58 |
+ libsystemd-dev |
|
| 59 |
+ pkg-config # for detecting things like libsystemd-journal dynamically |
|
| 60 |
+ ) |
|
| 61 |
+ |
|
| 62 |
+ case "$suite" in |
|
| 63 |
+ # ppc64le support was backported into libseccomp 2.2.3-2, |
|
| 64 |
+ # so enable seccomp by default |
|
| 65 |
+ *) |
|
| 66 |
+ extraBuildTags+=' seccomp' |
|
| 67 |
+ runcBuildTags="apparmor seccomp selinux" |
|
| 68 |
+ ;; |
|
| 69 |
+ esac |
|
| 70 |
+ |
|
| 71 |
+ # update and install packages |
|
| 72 |
+ echo "RUN apt-get update && apt-get install -y ${packages[*]} --no-install-recommends && rm -rf /var/lib/apt/lists/*" >> "$version/Dockerfile"
|
|
| 73 |
+ echo >> "$version/Dockerfile" |
|
| 74 |
+ |
|
| 75 |
+ # ppc64le doesn't have an official downloadable binary as of go 1.6.2. so use the |
|
| 76 |
+ # older packaged go(v1.6.1) to bootstrap latest go, then remove the packaged go |
|
| 77 |
+ awk '$1 == "ENV" && $2 == "GO_VERSION" { print; exit }' ../../../../Dockerfile.ppc64le >> "$version/Dockerfile"
|
|
| 78 |
+ echo 'ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz' >> "$version/Dockerfile"
|
|
| 79 |
+ echo 'ENV GOROOT_BOOTSTRAP /usr/lib/go-1.6' >> "$version/Dockerfile" |
|
| 80 |
+ echo >> "$version/Dockerfile" |
|
| 81 |
+ |
|
| 82 |
+ echo 'RUN curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \' >> "$version/Dockerfile" |
|
| 83 |
+ echo ' && tar -C /usr/local -xzf golang.tar.gz \' >> "$version/Dockerfile" |
|
| 84 |
+ echo ' && rm golang.tar.gz \' >> "$version/Dockerfile" |
|
| 85 |
+ echo ' && cd /usr/local/go/src && ./make.bash 2>&1 \' >> "$version/Dockerfile" |
|
| 86 |
+ echo ' && apt-get purge -y golang-go && apt-get autoremove -y' >> "$version/Dockerfile" |
|
| 87 |
+ echo >> "$version/Dockerfile" |
|
| 88 |
+ |
|
| 89 |
+ echo 'ENV PATH $PATH:/usr/local/go/bin' >> "$version/Dockerfile" |
|
| 90 |
+ echo >> "$version/Dockerfile" |
|
| 91 |
+ |
|
| 92 |
+ echo 'ENV AUTO_GOPATH 1' >> "$version/Dockerfile" |
|
| 93 |
+ echo >> "$version/Dockerfile" |
|
| 94 |
+ |
|
| 95 |
+ # print build tags in alphabetical order |
|
| 96 |
+ buildTags=$( echo "apparmor selinux $extraBuildTags" | xargs -n1 | sort -n | tr '\n' ' ' | sed -e 's/[[:space:]]*$//' ) |
|
| 97 |
+ echo "ENV DOCKER_BUILDTAGS $buildTags" >> "$version/Dockerfile" |
|
| 98 |
+ echo "ENV RUNC_BUILDTAGS $runcBuildTags" >> "$version/Dockerfile" |
|
| 99 |
+done |
| 0 | 100 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,24 @@ |
| 0 |
+# |
|
| 1 |
+# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/ppc64le/generate.sh"! |
|
| 2 |
+# |
|
| 3 |
+ |
|
| 4 |
+FROM ppc64le/ubuntu:xenial |
|
| 5 |
+ |
|
| 6 |
+RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-apparmor dh-systemd git golang-go libapparmor-dev libdevmapper-dev libltdl-dev libseccomp-dev libsqlite3-dev libsystemd-dev pkg-config --no-install-recommends && rm -rf /var/lib/apt/lists/* |
|
| 7 |
+ |
|
| 8 |
+ENV GO_VERSION 1.6.3 |
|
| 9 |
+ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz
|
|
| 10 |
+ENV GOROOT_BOOTSTRAP /usr/lib/go-1.6 |
|
| 11 |
+ |
|
| 12 |
+RUN curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \ |
|
| 13 |
+ && tar -C /usr/local -xzf golang.tar.gz \ |
|
| 14 |
+ && rm golang.tar.gz \ |
|
| 15 |
+ && cd /usr/local/go/src && ./make.bash 2>&1 \ |
|
| 16 |
+ && apt-get purge -y golang-go && apt-get autoremove -y |
|
| 17 |
+ |
|
| 18 |
+ENV PATH $PATH:/usr/local/go/bin |
|
| 19 |
+ |
|
| 20 |
+ENV AUTO_GOPATH 1 |
|
| 21 |
+ |
|
| 22 |
+ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux |
|
| 23 |
+ENV RUNC_BUILDTAGS apparmor seccomp selinux |
| 0 | 24 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,25 @@ |
| 0 |
+FROM ppc64le/ubuntu:xenial |
|
| 1 |
+ |
|
| 2 |
+RUN apt-get update && apt-get install -y git golang-go |
|
| 3 |
+ |
|
| 4 |
+RUN mkdir -p /go/src /go/bin /go/pkg |
|
| 5 |
+ENV GOPATH=/go:/usr/lib/go-1.6 |
|
| 6 |
+RUN export GLIDE=v0.11.1; \ |
|
| 7 |
+ export TARGET=/go/src/github.com/Masterminds; \ |
|
| 8 |
+ mkdir -p ${TARGET} && \
|
|
| 9 |
+ git clone https://github.com/Masterminds/glide.git ${TARGET}/glide && \
|
|
| 10 |
+ cd ${TARGET}/glide && \
|
|
| 11 |
+ git checkout $GLIDE && \ |
|
| 12 |
+ make build && \ |
|
| 13 |
+ cp ./glide /usr/bin/glide && \ |
|
| 14 |
+ cd / && rm -rf /go/src/* /go/bin/* /go/pkg/* |
|
| 15 |
+ |
|
| 16 |
+COPY glide.yaml /manvendor/ |
|
| 17 |
+COPY glide.lock /manvendor/ |
|
| 18 |
+WORKDIR /manvendor/ |
|
| 19 |
+RUN glide install && mv vendor src |
|
| 20 |
+ENV GOPATH=$GOPATH:/go/src/github.com/docker/docker/vendor:/manvendor |
|
| 21 |
+RUN go build -o /usr/bin/go-md2man github.com/cpuguy83/go-md2man |
|
| 22 |
+ |
|
| 23 |
+WORKDIR /go/src/github.com/docker/docker/ |
|
| 24 |
+ENTRYPOINT ["man/generate.sh"] |