From b529d1b0936b90ae14d584c73f7332919f8d76b7 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Fri, 16 Feb 2018 13:51:30 -0500 Subject: [PATCH] Split binary installers/commit scripts Originally I worked on this for the multi-stage build Dockerfile changes. Decided to split this out as we are still waiting for multi-stage to be available on CI and rebasing these is pretty annoying. Signed-off-by: Brian Goff --- Dockerfile | 11 +- Dockerfile.aarch64 | 13 +- Dockerfile.armhf | 11 +- Dockerfile.e2e | 2 +- Dockerfile.ppc64le | 11 +- Dockerfile.s390x | 11 +- Dockerfile.simple | 9 +- hack/dockerfile/binaries-commits | 23 --- hack/dockerfile/install-binaries.sh | 176 ------------------ hack/dockerfile/install/containerd.installer | 31 +++ hack/dockerfile/install/dockercli.installer | 31 +++ .../dockerfile/install/gometalinter.installer | 12 ++ hack/dockerfile/install/install.sh | 30 +++ hack/dockerfile/install/proxy.installer | 37 ++++ hack/dockerfile/install/runc.installer | 17 ++ hack/dockerfile/install/tini.installer | 14 ++ hack/dockerfile/install/tomlv.installer | 12 ++ hack/dockerfile/install/vndr.installer | 11 ++ hack/make/.go-autogen | 4 +- vendor.conf | 6 +- 20 files changed, 239 insertions(+), 233 deletions(-) delete mode 100644 hack/dockerfile/binaries-commits delete mode 100755 hack/dockerfile/install-binaries.sh create mode 100755 hack/dockerfile/install/containerd.installer create mode 100755 hack/dockerfile/install/dockercli.installer create mode 100755 hack/dockerfile/install/gometalinter.installer create mode 100755 hack/dockerfile/install/install.sh create mode 100755 hack/dockerfile/install/proxy.installer create mode 100755 hack/dockerfile/install/runc.installer create mode 100755 hack/dockerfile/install/tini.installer create mode 100755 hack/dockerfile/install/tomlv.installer create mode 100755 hack/dockerfile/install/vndr.installer diff --git a/Dockerfile b/Dockerfile index 30c5dcd291..bd42d81c46 100644 --- a/Dockerfile +++ b/Dockerfile @@ -187,11 +187,12 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \ hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c # See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list) -# Install tomlv, vndr, runc, containerd, tini, docker-proxy dockercli -# Please edit hack/dockerfile/install-binaries.sh to update them. -COPY hack/dockerfile/binaries-commits /tmp/binaries-commits -COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh -RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter +# Install tomlv, vndr, runc, containerd, tini, proxy dockercli +# Please edit hack/dockerfile/install/.installer to update them. +COPY hack/dockerfile/install hack/dockerfile/install +RUN for i in tomlv vndr tini gometalinter proxy dockercli runc containerd; \ + do hack/dockerfile/install/install.sh $i; \ + done ENV PATH=/usr/local/cli:$PATH # Activate bash completion and include Docker's completion if mounted with DOCKER_BASH_COMPLETION_PATH diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 8907384496..68df256e74 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -151,14 +151,17 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \ debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \ hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c # See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list) +# -# Install tomlv, vndr, runc, containerd, tini, docker-proxy -# Please edit hack/dockerfile/install-binaries.sh to update them. -COPY hack/dockerfile/binaries-commits /tmp/binaries-commits -COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh -RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter +# Install tomlv, vndr, runc, containerd, tini, proxy dockercli +# Please edit hack/dockerfile/install/.installer to update them. +COPY hack/dockerfile/install hack/dockerfile/install +RUN for i in tomlv vndr tini gometalinter proxy dockercli runc containerd; \ + do hack/dockerfile/install/install.sh $i; \ + done ENV PATH=/usr/local/cli:$PATH + # Wrap all commands in the "docker-in-docker" script to allow nested containers ENTRYPOINT ["hack/dind"] diff --git a/Dockerfile.armhf b/Dockerfile.armhf index b6a8ed301f..1978be7610 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -138,11 +138,12 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \ hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c # See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list) -# Install tomlv, vndr, runc, containerd, tini, docker-proxy -# Please edit hack/dockerfile/install-binaries.sh to update them. -COPY hack/dockerfile/binaries-commits /tmp/binaries-commits -COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh -RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter +# Install tomlv, vndr, runc, containerd, tini, proxy dockercli +# Please edit hack/dockerfile/install/.installer to update them. +COPY hack/dockerfile/install hack/dockerfile/install +RUN for i in tomlv vndr tini gometalinter proxy dockercli runc containerd; \ + do hack/dockerfile/install/install.sh $i; \ + done ENV PATH=/usr/local/cli:$PATH ENTRYPOINT ["hack/dind"] diff --git a/Dockerfile.e2e b/Dockerfile.e2e index bfac86d291..88edc5a907 100644 --- a/Dockerfile.e2e +++ b/Dockerfile.e2e @@ -23,7 +23,7 @@ RUN contrib/download-frozen-image-v2.sh /output/docker-frozen-images \ # Download Docker CLI binary COPY hack/dockerfile hack/dockerfile -RUN hack/dockerfile/install-binaries.sh dockercli +RUN hack/dockerfile/install.sh dockercli # Set tag and add sources ARG DOCKER_GITCOMMIT diff --git a/Dockerfile.ppc64le b/Dockerfile.ppc64le index 690ed491c1..c4aaa831e8 100644 --- a/Dockerfile.ppc64le +++ b/Dockerfile.ppc64le @@ -136,11 +136,12 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \ hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c # See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list) -# Install tomlv, vndr, runc, containerd, tini, docker-proxy -# Please edit hack/dockerfile/install-binaries.sh to update them. -COPY hack/dockerfile/binaries-commits /tmp/binaries-commits -COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh -RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter +# Install tomlv, vndr, runc, containerd, tini, proxy dockercli +# Please edit hack/dockerfile/install/.installer to update them. +COPY hack/dockerfile/install hack/dockerfile/install +RUN for i in tomlv vndr tini gometalinter proxy dockercli runc containerd; \ + do hack/dockerfile/install/install.sh $i; \ + done ENV PATH=/usr/local/cli:$PATH # Wrap all commands in the "docker-in-docker" script to allow nested containers diff --git a/Dockerfile.s390x b/Dockerfile.s390x index 53a567dcab..d6bc28ecf2 100644 --- a/Dockerfile.s390x +++ b/Dockerfile.s390x @@ -130,11 +130,12 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \ hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c # See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list) -# Install tomlv, vndr, runc, containerd, tini, docker-proxy -# Please edit hack/dockerfile/install-binaries.sh to update them. -COPY hack/dockerfile/binaries-commits /tmp/binaries-commits -COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh -RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter +# Install tomlv, vndr, runc, containerd, tini, proxy dockercli +# Please edit hack/dockerfile/install/.installer to update them. +COPY hack/dockerfile/install hack/dockerfile/install +RUN for i in tomlv vndr tini gometalinter proxy dockercli runc containerd; \ + do hack/dockerfile/install/install.sh $i; \ + done ENV PATH=/usr/local/cli:$PATH # Wrap all commands in the "docker-in-docker" script to allow nested containers diff --git a/Dockerfile.simple b/Dockerfile.simple index 6ab59da6db..b1e5584257 100644 --- a/Dockerfile.simple +++ b/Dockerfile.simple @@ -50,10 +50,11 @@ ENV GOPATH /go ENV CGO_LDFLAGS -L/lib # Install runc, containerd, tini and docker-proxy -# Please edit hack/dockerfile/install-binaries.sh to update them. -COPY hack/dockerfile/binaries-commits /tmp/binaries-commits -COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh -RUN /tmp/install-binaries.sh runc containerd tini proxy dockercli +# Please edit hack/dockerfile/install/.installer to update them. +COPY hack/dockerfile/install hack/dockerfile/install +RUN for i in runc containerd tini proxy dockercli; \ + do hack/dockerfile/install/install.sh $i; \ + done ENV PATH=/usr/local/cli:$PATH ENV AUTO_GOPATH 1 diff --git a/hack/dockerfile/binaries-commits b/hack/dockerfile/binaries-commits deleted file mode 100644 index b04b0d3ae2..0000000000 --- a/hack/dockerfile/binaries-commits +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# When updating TOMLV_COMMIT, consider updating github.com/BurntSushi/toml -# in vendor.conf accordingly -TOMLV_COMMIT=a368813c5e648fee92e5f6c30e3944ff9d5e8895 - -# When updating RUNC_COMMIT, also update runc in vendor.conf accordingly -RUNC_COMMIT=6c55f98695e902427906eed2c799e566e3d3dfb5 - -# containerd is also pinned in vendor.conf. When updating the binary -# version you may also need to update the vendor version to pick up bug -# fixes or new APIs. -CONTAINERD_COMMIT=cfd04396dc68220d1cecbe686a6cc3aa5ce3667c # v1.0.2 -TINI_COMMIT=949e6facb77383876aeff8a6944dde66b3089574 - -# LIBNETWORK_COMMIT is used to build the docker-userland-proxy binary. When -# updating the binary version, consider updating github.com/docker/libnetwork -# in vendor.conf accordingly -LIBNETWORK_COMMIT=ed2130d117c11c542327b4d5216a5db36770bc65 -VNDR_COMMIT=a6e196d8b4b0cbbdc29aebdb20c59ac6926bb384 - -# Linting -GOMETALINTER_COMMIT=bfcc1d6942136fd86eb6f1a6fb328de8398fbd80 diff --git a/hack/dockerfile/install-binaries.sh b/hack/dockerfile/install-binaries.sh deleted file mode 100755 index 69885a5eac..0000000000 --- a/hack/dockerfile/install-binaries.sh +++ /dev/null @@ -1,176 +0,0 @@ -#!/usr/bin/env bash -set -e -set -x - -. $(dirname "$0")/binaries-commits - -RM_GOPATH=0 - -TMP_GOPATH=${TMP_GOPATH:-""} - -if [ -z "$TMP_GOPATH" ]; then - export GOPATH="$(mktemp -d)" - RM_GOPATH=1 -else - export GOPATH="$TMP_GOPATH" -fi - -# Do not build with ambient capabilities support -RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp apparmor selinux"}" - -install_runc() { - echo "Install runc version $RUNC_COMMIT" - git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" - cd "$GOPATH/src/github.com/opencontainers/runc" - git checkout -q "$RUNC_COMMIT" - make BUILDTAGS="$RUNC_BUILDTAGS" $1 - cp runc /usr/local/bin/docker-runc -} - -install_containerd() { - echo "Install containerd version $CONTAINERD_COMMIT" - git clone https://github.com/containerd/containerd.git "$GOPATH/src/github.com/containerd/containerd" - cd "$GOPATH/src/github.com/containerd/containerd" - git checkout -q "$CONTAINERD_COMMIT" - ( - export GOPATH - make - ) - cp bin/containerd /usr/local/bin/docker-containerd - cp bin/containerd-shim /usr/local/bin/docker-containerd-shim - cp bin/ctr /usr/local/bin/docker-containerd-ctr -} - -install_containerd_static() { - echo "Install containerd version $CONTAINERD_COMMIT" - git clone https://github.com/containerd/containerd.git "$GOPATH/src/github.com/containerd/containerd" - cd "$GOPATH/src/github.com/containerd/containerd" - git checkout -q "$CONTAINERD_COMMIT" - ( - export GOPATH - make BUILDTAGS='static_build netgo' EXTRA_FLAGS="-buildmode pie" EXTRA_LDFLAGS='-extldflags "-fno-PIC -static"' - ) - cp bin/containerd /usr/local/bin/docker-containerd - cp bin/containerd-shim /usr/local/bin/docker-containerd-shim - cp bin/ctr /usr/local/bin/docker-containerd-ctr -} - -install_proxy() { - echo "Install docker-proxy version $LIBNETWORK_COMMIT" - git clone https://github.com/docker/libnetwork.git "$GOPATH/src/github.com/docker/libnetwork" - cd "$GOPATH/src/github.com/docker/libnetwork" - git checkout -q "$LIBNETWORK_COMMIT" - go build -buildmode=pie -ldflags="$PROXY_LDFLAGS" -o /usr/local/bin/docker-proxy github.com/docker/libnetwork/cmd/proxy -} - -install_dockercli() { - DOCKERCLI_CHANNEL=${DOCKERCLI_CHANNEL:-edge} - DOCKERCLI_VERSION=${DOCKERCLI_VERSION:-17.06.0-ce} - echo "Install docker/cli version $DOCKERCLI_VERSION from $DOCKERCLI_CHANNEL" - - arch=$(uname -m) - # No official release of these platforms - if [[ "$arch" != "x86_64" ]] && [[ "$arch" != "s390x" ]]; then - build_dockercli - return - fi - - url=https://download.docker.com/linux/static - curl -Ls $url/$DOCKERCLI_CHANNEL/$arch/docker-$DOCKERCLI_VERSION.tgz | \ - tar -xz docker/docker - mv docker/docker /usr/local/bin/ - rmdir docker -} - -build_dockercli() { - DOCKERCLI_VERSION=${DOCKERCLI_VERSION:-17.06.0-ce} - git clone https://github.com/docker/docker-ce "$GOPATH/tmp/docker-ce" - cd "$GOPATH/tmp/docker-ce" - git checkout -q "v$DOCKERCLI_VERSION" - mkdir -p "$GOPATH/src/github.com/docker" - mv components/cli "$GOPATH/src/github.com/docker/cli" - go build -buildmode=pie -o /usr/local/bin/docker github.com/docker/cli/cmd/docker -} - -install_gometalinter() { - echo "Installing gometalinter version $GOMETALINTER_COMMIT" - go get -d github.com/alecthomas/gometalinter - cd "$GOPATH/src/github.com/alecthomas/gometalinter" - git checkout -q "$GOMETALINTER_COMMIT" - go build -buildmode=pie -o /usr/local/bin/gometalinter github.com/alecthomas/gometalinter - GOBIN=/usr/local/bin gometalinter --install -} - -for prog in "$@" -do - case $prog in - tomlv) - echo "Install tomlv version $TOMLV_COMMIT" - git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml" - cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT" - go build -buildmode=pie -v -o /usr/local/bin/tomlv github.com/BurntSushi/toml/cmd/tomlv - ;; - - runc) - install_runc static - ;; - - runc-dynamic) - install_runc - ;; - - containerd) - install_containerd_static - ;; - - containerd-dynamic) - install_containerd - ;; - - gometalinter) - install_gometalinter - ;; - - tini) - echo "Install tini version $TINI_COMMIT" - git clone https://github.com/krallin/tini.git "$GOPATH/tini" - cd "$GOPATH/tini" - git checkout -q "$TINI_COMMIT" - cmake . - make tini-static - cp tini-static /usr/local/bin/docker-init - ;; - - proxy) - ( - export CGO_ENABLED=0 - install_proxy - ) - ;; - - proxy-dynamic) - PROXY_LDFLAGS="-linkmode=external" install_proxy - ;; - - vndr) - echo "Install vndr version $VNDR_COMMIT" - git clone https://github.com/LK4D4/vndr.git "$GOPATH/src/github.com/LK4D4/vndr" - cd "$GOPATH/src/github.com/LK4D4/vndr" - git checkout -q "$VNDR_COMMIT" - go build -buildmode=pie -v -o /usr/local/bin/vndr . - ;; - - dockercli) - install_dockercli - ;; - - *) - echo echo "Usage: $0 [tomlv|runc|runc-dynamic|containerd|containerd-dynamic|tini|proxy|proxy-dynamic|vndr|dockercli|gometalinter]" - exit 1 - - esac -done - -if [ $RM_GOPATH -eq 1 ]; then - rm -rf "$GOPATH" -fi diff --git a/hack/dockerfile/install/containerd.installer b/hack/dockerfile/install/containerd.installer new file mode 100755 index 0000000000..5731a6d560 --- /dev/null +++ b/hack/dockerfile/install/containerd.installer @@ -0,0 +1,31 @@ +#!/bin/sh + + +# containerd is also pinned in vendor.conf. When updating the binary +# version you may also need to update the vendor version to pick up bug +# fixes or new APIs. +CONTAINERD_COMMIT=cfd04396dc68220d1cecbe686a6cc3aa5ce3667c # v1.0.2 + +install_containerd() { + echo "Install containerd version $CONTAINERD_COMMIT" + git clone https://github.com/containerd/containerd.git "$GOPATH/src/github.com/containerd/containerd" + cd "$GOPATH/src/github.com/containerd/containerd" + git checkout -q "$CONTAINERD_COMMIT" + + ( + + if [ "$1" == "static" ]; then + export BUILDTAGS='static_build netgo' + export EXTRA_FLAGS='-buildmod pie' + export EXTRA_LDFLAGS='-extldflags "-fno-PIC -static"' + fi + + make + ) + + mkdir -p ${PREFIX} + + cp bin/containerd ${PREFIX}/docker-containerd + cp bin/containerd-shim ${PREFIX}/docker-containerd-shim + cp bin/ctr ${PREFIX}/docker-containerd-ctr +} diff --git a/hack/dockerfile/install/dockercli.installer b/hack/dockerfile/install/dockercli.installer new file mode 100755 index 0000000000..ae3aa0dd45 --- /dev/null +++ b/hack/dockerfile/install/dockercli.installer @@ -0,0 +1,31 @@ +#!/bin/sh + +DOCKERCLI_CHANNEL=${DOCKERCLI_CHANNEL:-edge} +DOCKERCLI_VERSION=${DOCKERCLI_VERSION:-17.06.0-ce} + +install_dockercli() { + echo "Install docker/cli version $DOCKERCLI_VERSION from $DOCKERCLI_CHANNEL" + + arch=$(uname -m) + # No official release of these platforms + if [[ "$arch" != "x86_64" ]] && [[ "$arch" != "s390x" ]]; then + build_dockercli + return + fi + + url=https://download.docker.com/linux/static + curl -Ls $url/$DOCKERCLI_CHANNEL/$arch/docker-$DOCKERCLI_VERSION.tgz | \ + tar -xz docker/docker + mkdir -p ${PREFIX} + mv docker/docker ${PREFIX}/ + rmdir docker +} + +build_dockercli() { + git clone https://github.com/docker/docker-ce "$GOPATH/tmp/docker-ce" + cd "$GOPATH/tmp/docker-ce" + git checkout -q "v$DOCKERCLI_VERSION" + mkdir -p "$GOPATH/src/github.com/docker" + mv components/cli "$GOPATH/src/github.com/docker/cli" + go build -buildmode=pie -o ${PREFIX}/docker github.com/docker/cli/cmd/docker +} diff --git a/hack/dockerfile/install/gometalinter.installer b/hack/dockerfile/install/gometalinter.installer new file mode 100755 index 0000000000..13500e1c89 --- /dev/null +++ b/hack/dockerfile/install/gometalinter.installer @@ -0,0 +1,12 @@ +#!/bin/sh + +GOMETALINTER_COMMIT=bfcc1d6942136fd86eb6f1a6fb328de8398fbd80 + +install_gometalinter() { + echo "Installing gometalinter version $GOMETALINTER_COMMIT" + go get -d github.com/alecthomas/gometalinter + cd "$GOPATH/src/github.com/alecthomas/gometalinter" + git checkout -q "$GOMETALINTER_COMMIT" + go build -buildmode=pie -o ${PREFIX}/gometalinter github.com/alecthomas/gometalinter + GOBIN=${PREFIX} ${PREFIX}/gometalinter --install +} diff --git a/hack/dockerfile/install/install.sh b/hack/dockerfile/install/install.sh new file mode 100755 index 0000000000..a0ff09da55 --- /dev/null +++ b/hack/dockerfile/install/install.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -e +set -x + +RM_GOPATH=0 + +TMP_GOPATH=${TMP_GOPATH:-""} + +: ${PREFIX:="/usr/local/bin"} + +if [ -z "$TMP_GOPATH" ]; then + export GOPATH="$(mktemp -d)" + RM_GOPATH=1 +else + export GOPATH="$TMP_GOPATH" +fi + +dir="$(dirname $0)" + +bin=$1 +shift + +if [ ! -f "${dir}/${bin}.installer" ]; then + echo "Could not find installer for \"$bin\"" + exit 1 +fi + +. $dir/$bin.installer +install_$bin "$@" diff --git a/hack/dockerfile/install/proxy.installer b/hack/dockerfile/install/proxy.installer new file mode 100755 index 0000000000..598f67c3fb --- /dev/null +++ b/hack/dockerfile/install/proxy.installer @@ -0,0 +1,37 @@ +#!/bin/sh + +# LIBNETWORK_COMMIT is used to build the docker-userland-proxy binary. When +# updating the binary version, consider updating github.com/docker/libnetwork +# in vendor.conf accordingly +LIBNETWORK_COMMIT=ed2130d117c11c542327b4d5216a5db36770bc65 + +install_proxy() { + case "$1" in + "dynamic") + install_proxy_dynamic + return + ;; + "") + export CGO_ENABLED=0 + _install_proxy + ;; + *) + echo 'Usage: $0 [dynamic]' + ;; + esac +} + +install_proxy_dynamic() { + export PROXY_LDFLAGS="-linkmode=external" install_proxy + _install_proxy +} + +_install_proxy() { + echo "Install docker-proxy version $LIBNETWORK_COMMIT" + git clone https://github.com/docker/libnetwork.git "$GOPATH/src/github.com/docker/libnetwork" + cd "$GOPATH/src/github.com/docker/libnetwork" + git checkout -q "$LIBNETWORK_COMMIT" + go build -buildmode=pie -ldflags="$PROXY_LDFLAGS" -o ${PREFIX}/docker-proxy github.com/docker/libnetwork/cmd/proxy +} + + diff --git a/hack/dockerfile/install/runc.installer b/hack/dockerfile/install/runc.installer new file mode 100755 index 0000000000..923ae706e1 --- /dev/null +++ b/hack/dockerfile/install/runc.installer @@ -0,0 +1,17 @@ +#!/bin/sh + +# When updating RUNC_COMMIT, also update runc in vendor.conf accordingly +RUNC_COMMIT=6c55f98695e902427906eed2c799e566e3d3dfb5 + +install_runc() { + # Do not build with ambient capabilities support + RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp apparmor selinux"}" + + echo "Install runc version $RUNC_COMMIT" + git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" + cd "$GOPATH/src/github.com/opencontainers/runc" + git checkout -q "$RUNC_COMMIT" + make BUILDTAGS="$RUNC_BUILDTAGS" $1 + mkdir -p ${PREFIX} + cp runc ${PREFIX}/docker-runc +} diff --git a/hack/dockerfile/install/tini.installer b/hack/dockerfile/install/tini.installer new file mode 100755 index 0000000000..d1c2deb62e --- /dev/null +++ b/hack/dockerfile/install/tini.installer @@ -0,0 +1,14 @@ +#!/bin/sh + +TINI_COMMIT=949e6facb77383876aeff8a6944dde66b3089574 + +install_tini() { + echo "Install tini version $TINI_COMMIT" + git clone https://github.com/krallin/tini.git "$GOPATH/tini" + cd "$GOPATH/tini" + git checkout -q "$TINI_COMMIT" + cmake . + make tini-static + mkdir -p ${PREFIX} + cp tini-static ${PREFIX}/docker-init +} diff --git a/hack/dockerfile/install/tomlv.installer b/hack/dockerfile/install/tomlv.installer new file mode 100755 index 0000000000..c926454f22 --- /dev/null +++ b/hack/dockerfile/install/tomlv.installer @@ -0,0 +1,12 @@ +#!/bin/sh + +# When updating TOMLV_COMMIT, consider updating github.com/BurntSushi/toml +# in vendor.conf accordingly +TOMLV_COMMIT=a368813c5e648fee92e5f6c30e3944ff9d5e8895 + +install_tomlv() { + echo "Install tomlv version $TOMLV_COMMIT" + git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml" + cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT" + go build -v -buildmode=pie -o ${PREFIX}/tomlv github.com/BurntSushi/toml/cmd/tomlv +} diff --git a/hack/dockerfile/install/vndr.installer b/hack/dockerfile/install/vndr.installer new file mode 100755 index 0000000000..1d30eecc38 --- /dev/null +++ b/hack/dockerfile/install/vndr.installer @@ -0,0 +1,11 @@ +#!/bin/sh + +VNDR_COMMIT=a6e196d8b4b0cbbdc29aebdb20c59ac6926bb384 + +install_vndr() { + echo "Install vndr version $VNDR_COMMIT" + git clone https://github.com/LK4D4/vndr.git "$GOPATH/src/github.com/LK4D4/vndr" + cd "$GOPATH/src/github.com/LK4D4/vndr" + git checkout -q "$VNDR_COMMIT" + go build -buildmode=pie -v -o ${PREFIX}/vndr . +} diff --git a/hack/make/.go-autogen b/hack/make/.go-autogen index 850c3ec9ac..ba001895d8 100644 --- a/hack/make/.go-autogen +++ b/hack/make/.go-autogen @@ -2,7 +2,9 @@ rm -rf autogen -source hack/dockerfile/binaries-commits +source hack/dockerfile/install/runc.installer +source hack/dockerfile/install/tini.installer +source hack/dockerfile/install/containerd.installer cat > dockerversion/version_autogen.go <