2018-02-04 08:15:39 +08:00
|
|
|
FROM golang:1.10-stretch
|
2016-08-30 09:46:47 +08:00
|
|
|
|
2018-06-16 08:29:52 +08:00
|
|
|
RUN dpkg --add-architecture armel \
|
|
|
|
&& dpkg --add-architecture armhf \
|
|
|
|
&& dpkg --add-architecture arm64 \
|
|
|
|
&& dpkg --add-architecture ppc64el \
|
|
|
|
&& apt-get update && apt-get install -y \
|
2016-08-30 09:46:47 +08:00
|
|
|
build-essential \
|
|
|
|
curl \
|
2016-05-11 15:45:00 +08:00
|
|
|
sudo \
|
2016-08-30 09:46:47 +08:00
|
|
|
gawk \
|
|
|
|
iptables \
|
2016-10-25 15:00:51 +08:00
|
|
|
jq \
|
2016-08-30 09:46:47 +08:00
|
|
|
pkg-config \
|
|
|
|
libaio-dev \
|
|
|
|
libcap-dev \
|
|
|
|
libprotobuf-dev \
|
|
|
|
libprotobuf-c0-dev \
|
2017-03-03 03:07:34 +08:00
|
|
|
libnl-3-dev \
|
|
|
|
libnet-dev \
|
2018-02-04 08:15:39 +08:00
|
|
|
libseccomp2 \
|
|
|
|
libseccomp-dev \
|
2016-08-30 09:46:47 +08:00
|
|
|
protobuf-c-compiler \
|
|
|
|
protobuf-compiler \
|
|
|
|
python-minimal \
|
2017-09-07 07:54:46 +08:00
|
|
|
uidmap \
|
2018-03-01 07:31:10 +08:00
|
|
|
kmod \
|
2018-06-16 08:29:52 +08:00
|
|
|
crossbuild-essential-armel crossbuild-essential-armhf crossbuild-essential-arm64 crossbuild-essential-ppc64el \
|
|
|
|
libseccomp-dev:armel libseccomp-dev:armhf libseccomp-dev:arm64 libseccomp-dev:ppc64el \
|
2016-12-14 18:20:38 +08:00
|
|
|
--no-install-recommends \
|
|
|
|
&& apt-get clean
|
2016-08-30 09:46:47 +08:00
|
|
|
|
2016-05-11 15:45:00 +08:00
|
|
|
# Add a dummy user for the rootless integration tests. While runC does
|
|
|
|
# not require an entry in /etc/passwd to operate, one of the tests uses
|
|
|
|
# `git clone` -- and `git clone` does not allow you to clone a
|
|
|
|
# repository if the current uid does not have an entry in /etc/passwd.
|
|
|
|
RUN useradd -u1000 -m -d/home/rootless -s/bin/bash rootless
|
|
|
|
|
2016-08-30 09:46:47 +08:00
|
|
|
# install bats
|
|
|
|
RUN cd /tmp \
|
|
|
|
&& git clone https://github.com/sstephenson/bats.git \
|
|
|
|
&& cd bats \
|
|
|
|
&& git reset --hard 03608115df2071fff4eaaff1605768c275e5f81f \
|
2016-10-09 09:43:22 +08:00
|
|
|
&& ./install.sh /usr/local \
|
|
|
|
&& rm -rf /tmp/bats
|
2016-08-30 09:46:47 +08:00
|
|
|
|
|
|
|
# install criu
|
2018-08-10 21:28:00 +08:00
|
|
|
# For criu v3.10, a patch is needed for `@test "checkpoint --lazy-pages and restore"`.
|
|
|
|
# Starting with v3.11, the patch will no longer be needed.
|
|
|
|
# See https://github.com/opencontainers/runc/issues/1863#issuecomment-412074413
|
|
|
|
ENV CRIU_VERSION v3.10
|
2016-08-30 09:46:47 +08:00
|
|
|
RUN mkdir -p /usr/src/criu \
|
2018-02-04 08:16:31 +08:00
|
|
|
&& curl -sSL https://github.com/checkpoint-restore/criu/archive/${CRIU_VERSION}.tar.gz | tar -v -C /usr/src/criu/ -xz --strip-components=1 \
|
2016-08-30 09:46:47 +08:00
|
|
|
&& cd /usr/src/criu \
|
2018-08-10 21:28:00 +08:00
|
|
|
&& curl https://github.com/checkpoint-restore/criu/commit/27034e7c64b00a1f2467afb5ebb1d5b9b1a06ce1.patch | patch -p1 \
|
2016-12-14 18:20:38 +08:00
|
|
|
&& make install-criu \
|
|
|
|
&& rm -rf /usr/src/criu
|
2016-08-30 09:46:47 +08:00
|
|
|
|
|
|
|
# setup a playground for us to spawn containers in
|
|
|
|
ENV ROOTFS /busybox
|
2017-11-07 10:36:56 +08:00
|
|
|
RUN mkdir -p ${ROOTFS}
|
2016-08-30 09:46:47 +08:00
|
|
|
|
|
|
|
COPY script/tmpmount /
|
|
|
|
WORKDIR /go/src/github.com/opencontainers/runc
|
|
|
|
ENTRYPOINT ["/tmpmount"]
|
|
|
|
|
2015-12-18 19:18:41 +08:00
|
|
|
ADD . /go/src/github.com/opencontainers/runc
|
2017-11-07 10:36:56 +08:00
|
|
|
|
|
|
|
RUN . tests/integration/multi-arch.bash \
|
|
|
|
&& curl -o- -sSL `get_busybox` | tar xfJC - ${ROOTFS}
|