2017-08-04 11:13:19 +00:00
|
|
|
FROM golang:1.8
|
2016-09-20 10:23:34 +00:00
|
|
|
|
|
|
|
# libseccomp in jessie is not _quite_ new enough -- need backports version
|
|
|
|
RUN echo 'deb http://httpredir.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
2017-07-17 19:58:49 +00:00
|
|
|
apparmor \
|
2017-07-13 17:13:36 +00:00
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
bison \
|
2016-09-20 10:23:34 +00:00
|
|
|
build-essential \
|
|
|
|
curl \
|
2017-07-13 17:13:36 +00:00
|
|
|
e2fslibs-dev \
|
2016-09-20 10:23:34 +00:00
|
|
|
gawk \
|
2017-09-19 17:45:08 +00:00
|
|
|
gettext \
|
2016-09-20 10:23:34 +00:00
|
|
|
iptables \
|
|
|
|
pkg-config \
|
|
|
|
libaio-dev \
|
|
|
|
libcap-dev \
|
2017-07-13 17:13:36 +00:00
|
|
|
libfuse-dev \
|
|
|
|
libostree-dev \
|
2016-09-20 10:23:34 +00:00
|
|
|
libprotobuf-dev \
|
|
|
|
libprotobuf-c0-dev \
|
|
|
|
libseccomp2/jessie-backports \
|
|
|
|
libseccomp-dev/jessie-backports \
|
2017-07-13 17:13:36 +00:00
|
|
|
libtool \
|
2017-09-12 23:29:24 +00:00
|
|
|
libudev-dev \
|
2016-09-20 10:23:34 +00:00
|
|
|
protobuf-c-compiler \
|
|
|
|
protobuf-compiler \
|
|
|
|
python-minimal \
|
2016-09-21 21:56:26 +00:00
|
|
|
libglib2.0-dev \
|
2016-12-01 13:15:47 +00:00
|
|
|
libapparmor-dev \
|
2016-12-07 21:42:31 +00:00
|
|
|
btrfs-tools \
|
|
|
|
libdevmapper1.02.1 \
|
|
|
|
libdevmapper-dev \
|
2016-10-18 14:48:33 +00:00
|
|
|
libgpgme11-dev \
|
2017-07-13 17:13:36 +00:00
|
|
|
liblzma-dev \
|
2017-06-17 00:41:54 +00:00
|
|
|
netcat \
|
2017-09-12 14:06:20 +00:00
|
|
|
socat \
|
2016-12-19 08:48:45 +00:00
|
|
|
--no-install-recommends \
|
2017-12-28 08:45:50 +00:00
|
|
|
bsdmainutils \
|
2016-12-19 08:48:45 +00:00
|
|
|
&& apt-get clean
|
2016-09-20 10:23:34 +00:00
|
|
|
|
|
|
|
# install bats
|
|
|
|
RUN cd /tmp \
|
|
|
|
&& git clone https://github.com/sstephenson/bats.git \
|
|
|
|
&& cd bats \
|
|
|
|
&& git reset --hard 03608115df2071fff4eaaff1605768c275e5f81f \
|
|
|
|
&& ./install.sh /usr/local
|
|
|
|
|
|
|
|
# install criu
|
|
|
|
ENV CRIU_VERSION 1.7
|
|
|
|
RUN mkdir -p /usr/src/criu \
|
|
|
|
&& curl -sSL https://github.com/xemul/criu/archive/v${CRIU_VERSION}.tar.gz | tar -v -C /usr/src/criu/ -xz --strip-components=1 \
|
|
|
|
&& cd /usr/src/criu \
|
2016-12-19 08:48:45 +00:00
|
|
|
&& make install-criu \
|
|
|
|
&& rm -rf /usr/src/criu
|
2016-09-20 10:23:34 +00:00
|
|
|
|
|
|
|
# Install runc
|
2018-01-19 21:37:10 +00:00
|
|
|
ENV RUNC_COMMIT 9f9c96235cc97674e935002fc3d78361b696a69e
|
2016-09-20 10:23:34 +00:00
|
|
|
RUN set -x \
|
|
|
|
&& export GOPATH="$(mktemp -d)" \
|
|
|
|
&& git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
|
|
|
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
2017-04-12 23:12:04 +00:00
|
|
|
&& git fetch origin --tags \
|
2016-09-20 10:23:34 +00:00
|
|
|
&& git checkout -q "$RUNC_COMMIT" \
|
|
|
|
&& make static BUILDTAGS="seccomp selinux" \
|
2017-10-24 09:55:20 +00:00
|
|
|
&& cp runc /usr/bin/runc \
|
2016-09-20 10:23:34 +00:00
|
|
|
&& rm -rf "$GOPATH"
|
|
|
|
|
2017-01-19 17:00:27 +00:00
|
|
|
# Install CNI plugins
|
2017-05-25 16:13:53 +00:00
|
|
|
ENV CNI_COMMIT dcf7368eeab15e2affc6256f0bb1e84dd46a34de
|
2017-01-19 17:00:27 +00:00
|
|
|
RUN set -x \
|
|
|
|
&& export GOPATH="$(mktemp -d)" \
|
2017-05-25 16:13:53 +00:00
|
|
|
&& git clone https://github.com/containernetworking/plugins.git "$GOPATH/src/github.com/containernetworking/plugins" \
|
|
|
|
&& cd "$GOPATH/src/github.com/containernetworking/plugins" \
|
2017-04-05 16:53:17 +00:00
|
|
|
&& git checkout -q "$CNI_COMMIT" \
|
|
|
|
&& ./build.sh \
|
2017-01-19 17:00:27 +00:00
|
|
|
&& mkdir -p /opt/cni/bin \
|
|
|
|
&& cp bin/* /opt/cni/bin/ \
|
|
|
|
&& rm -rf "$GOPATH"
|
|
|
|
|
2017-08-31 09:19:13 +00:00
|
|
|
# Install custom CNI bridge test plugin
|
|
|
|
# XXX: this plugin is meant to be a replacement for the old "test_plugin_args.bash"
|
|
|
|
# we need this in testing because sandbox_run now gather IP address and the mock
|
|
|
|
# plugin wasn't able to properly setup the net ns.
|
|
|
|
# The bridge is based on the same commit as the one above.
|
|
|
|
#ENV CNI_COMMIT 6bfe036c38c8e1410f1acaa4b2ee16f1851472e4
|
|
|
|
ENV CNI_TEST_BRANCH custom-bridge
|
|
|
|
RUN set -x \
|
|
|
|
&& export GOPATH="$(mktemp -d)" \
|
|
|
|
&& git clone https://github.com/runcom/plugins.git "$GOPATH/src/github.com/containernetworking/plugins" \
|
|
|
|
&& cd "$GOPATH/src/github.com/containernetworking/plugins" \
|
|
|
|
&& git checkout -q "$CNI_TEST_BRANCH" \
|
|
|
|
&& ./build.sh \
|
|
|
|
&& mkdir -p /opt/cni/bin \
|
|
|
|
&& cp bin/bridge /opt/cni/bin/bridge-custom \
|
|
|
|
&& rm -rf "$GOPATH"
|
|
|
|
|
2017-08-22 14:00:21 +00:00
|
|
|
# Install crictl
|
2018-01-26 02:06:38 +00:00
|
|
|
ENV CRICTL_COMMIT f1a58d681c056f259802f5cae2fe1fbcc6b28667
|
2017-08-22 14:00:21 +00:00
|
|
|
RUN set -x \
|
|
|
|
&& export GOPATH="$(mktemp -d)" \
|
|
|
|
&& git clone https://github.com/kubernetes-incubator/cri-tools.git "$GOPATH/src/github.com/kubernetes-incubator/cri-tools" \
|
|
|
|
&& cd "$GOPATH/src/github.com/kubernetes-incubator/cri-tools" \
|
|
|
|
&& git checkout -q "$CRICTL_COMMIT" \
|
|
|
|
&& go install github.com/kubernetes-incubator/cri-tools/cmd/crictl \
|
|
|
|
&& cp "$GOPATH"/bin/crictl /usr/bin/ \
|
|
|
|
&& rm -rf "$GOPATH"
|
|
|
|
|
2016-10-18 14:48:33 +00:00
|
|
|
# Make sure we have some policy for pulling images
|
|
|
|
RUN mkdir -p /etc/containers
|
|
|
|
COPY test/policy.json /etc/containers/policy.json
|
2017-08-10 13:49:07 +00:00
|
|
|
COPY test/redhat_sigstore.yaml /etc/containers/registries.d/registry.access.redhat.com.yaml
|
2016-10-18 14:48:33 +00:00
|
|
|
|
2016-09-26 23:55:12 +00:00
|
|
|
WORKDIR /go/src/github.com/kubernetes-incubator/cri-o
|
2016-09-20 10:23:34 +00:00
|
|
|
|
2016-09-26 23:55:12 +00:00
|
|
|
ADD . /go/src/github.com/kubernetes-incubator/cri-o
|