Build containerd binaries within the container

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2016-03-23 19:22:36 -07:00
parent ef821ea93f
commit 4796ec8d9d

View file

@ -6,6 +6,9 @@ RUN apt-get update && apt-get install -y \
curl \ curl \
git \ git \
make \ make \
jq \
apparmor \
libapparmor-dev \
--no-install-recommends \ --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* && 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 PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go:/go/src/github.com/docker/containerd/vendor ENV GOPATH /go:/go/src/github.com/docker/containerd/vendor
WORKDIR /go/src/github.com/docker/containerd
# install golint/vet # install golint/vet
RUN go get github.com/golang/lint/golint \ RUN go get github.com/golang/lint/golint \
&& go get golang.org/x/tools/cmd/vet && 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 COPY . /go/src/github.com/docker/containerd
WORKDIR /go/src/github.com/docker/containerd WORKDIR /go/src/github.com/docker/containerd