2015-12-18 17:08:14 +00:00
|
|
|
FROM debian:jessie
|
|
|
|
|
2016-06-03 22:00:49 +00:00
|
|
|
# allow replacing httpredir mirror
|
|
|
|
ARG APT_MIRROR=httpredir.debian.org
|
|
|
|
RUN sed -i s/httpredir.debian.org/$APT_MIRROR/g /etc/apt/sources.list
|
|
|
|
|
2015-12-18 17:08:14 +00:00
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
build-essential \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
git \
|
|
|
|
make \
|
2016-03-24 02:22:36 +00:00
|
|
|
jq \
|
2016-06-09 20:33:26 +00:00
|
|
|
pkg-config \
|
2016-03-24 02:22:36 +00:00
|
|
|
apparmor \
|
|
|
|
libapparmor-dev \
|
2015-12-18 17:08:14 +00:00
|
|
|
--no-install-recommends \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# Install Go
|
2016-06-09 20:33:26 +00:00
|
|
|
ENV GO_VERSION 1.6.2
|
2015-12-18 17:08:14 +00:00
|
|
|
RUN curl -sSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar -v -C /usr/local -xz
|
|
|
|
ENV PATH /go/bin:/usr/local/go/bin:$PATH
|
2016-03-17 23:10:24 +00:00
|
|
|
ENV GOPATH /go:/go/src/github.com/docker/containerd/vendor
|
2015-12-18 17:08:14 +00:00
|
|
|
|
2016-06-03 22:00:49 +00:00
|
|
|
ENV GO_TOOLS_COMMIT 823804e1ae08dbb14eb807afc7db9993bc9e3cc3
|
|
|
|
# Grab Go's cover tool for dead-simple code coverage testing
|
|
|
|
# Grab Go's vet tool for examining go code to find suspicious constructs
|
|
|
|
# and help prevent errors that the compiler might not catch
|
|
|
|
RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \
|
|
|
|
&& (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT) \
|
|
|
|
&& go install -v golang.org/x/tools/cmd/cover \
|
|
|
|
&& go install -v golang.org/x/tools/cmd/vet
|
|
|
|
# Grab Go's lint tool
|
|
|
|
ENV GO_LINT_COMMIT 32a87160691b3c96046c0c678fe57c5bef761456
|
|
|
|
RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \
|
|
|
|
&& (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
|
|
|
|
&& go install -v github.com/golang/lint/golint
|
|
|
|
|
2016-03-24 02:22:36 +00:00
|
|
|
WORKDIR /go/src/github.com/docker/containerd
|
|
|
|
|
|
|
|
# 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
|
2016-06-09 20:33:26 +00:00
|
|
|
ENV RUNC_COMMIT afaa21f79ade3b2e99a68f3f15e7219155aa4662
|
2016-03-24 02:22:36 +00:00
|
|
|
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
|
|
|
|
|
2015-12-18 17:08:14 +00:00
|
|
|
COPY . /go/src/github.com/docker/containerd
|
|
|
|
|
|
|
|
WORKDIR /go/src/github.com/docker/containerd
|
2016-05-13 18:44:01 +00:00
|
|
|
|
|
|
|
RUN make all install
|