From 4796ec8d9da50c05b2d5378569dafe7b8758e4e0 Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Wed, 23 Mar 2016 19:22:36 -0700 Subject: [PATCH] Build containerd binaries within the container Signed-off-by: Kenfe-Mickael Laventure --- Dockerfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Dockerfile b/Dockerfile index 345f85f..2bb508f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,9 @@ RUN apt-get update && apt-get install -y \ curl \ git \ make \ + jq \ + apparmor \ + libapparmor-dev \ --no-install-recommends \ && rm -rf /var/lib/apt/lists/* @@ -15,10 +18,36 @@ RUN curl -sSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd6 ENV PATH /go/bin:/usr/local/go/bin:$PATH ENV GOPATH /go:/go/src/github.com/docker/containerd/vendor +WORKDIR /go/src/github.com/docker/containerd + # install golint/vet RUN go get github.com/golang/lint/golint \ && go get golang.org/x/tools/cmd/vet +# install seccomp: the version shipped in trusty is too old +ENV SECCOMP_VERSION 2.3.0 +RUN set -x \ + && export SECCOMP_PATH="$(mktemp -d)" \ + && curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \ + | tar -xzC "$SECCOMP_PATH" --strip-components=1 \ + && ( \ + cd "$SECCOMP_PATH" \ + && ./configure --prefix=/usr/local \ + && make \ + && make install \ + && ldconfig \ + ) \ + && rm -rf "$SECCOMP_PATH" + +# Install runc +ENV RUNC_COMMIT bbde9c426ff363d813b8722f0744115c13b408b6 +RUN set -x \ + && export GOPATH="$(mktemp -d)" \ + && git clone git://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="seccomp apparmor selinux" && make install + COPY . /go/src/github.com/docker/containerd WORKDIR /go/src/github.com/docker/containerd