mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
3e99aa3628
The Travis tests running on Fedora 31 with cgroup2 on Vagrant had the CRIU parts disabled because of a couple of problems. One problem was a bug in runc and CRIU handling that Andrei fixed. In addition four patches from the upcoming CRIU 3.14 are needed for minimal cgroup2 support (freezer and mounting of cgroup2). With Andrei's fix and the CRIU cgroup2 support and the runc CRIU cgroup2 integration it is now possible the checkpoint integration tests again on the Fedora Vagrant cgroup2 based integration test. To run CRIU based tests the modules of Fedora 31 (the test host system) are mounted inside of the container used to test runc in the buster based container with -v /lib/modules:/lib/modules. Signed-off-by: Adrian Reber <areber@redhat.com>
86 lines
2.9 KiB
Docker
86 lines
2.9 KiB
Docker
ARG GO_VERSION=1.13
|
|
ARG BATS_VERSION=03608115df2071fff4eaaff1605768c275e5f81f
|
|
ARG CRIU_VERSION=v3.13
|
|
|
|
FROM golang:${GO_VERSION}-buster
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN dpkg --add-architecture armel \
|
|
&& dpkg --add-architecture armhf \
|
|
&& dpkg --add-architecture arm64 \
|
|
&& dpkg --add-architecture ppc64el \
|
|
&& apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
crossbuild-essential-arm64 \
|
|
crossbuild-essential-armel \
|
|
crossbuild-essential-armhf \
|
|
crossbuild-essential-ppc64el \
|
|
curl \
|
|
gawk \
|
|
iptables \
|
|
jq \
|
|
kmod \
|
|
libaio-dev \
|
|
libcap-dev \
|
|
libnet-dev \
|
|
libnl-3-dev \
|
|
libprotobuf-c-dev \
|
|
libprotobuf-dev \
|
|
libseccomp-dev \
|
|
libseccomp-dev:arm64 \
|
|
libseccomp-dev:armel \
|
|
libseccomp-dev:armhf \
|
|
libseccomp-dev:ppc64el \
|
|
libseccomp2 \
|
|
pkg-config \
|
|
protobuf-c-compiler \
|
|
protobuf-compiler \
|
|
python-minimal \
|
|
sudo \
|
|
uidmap \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/cache/apt /var/lib/apt/lists/*;
|
|
|
|
# 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
|
|
|
|
# install bats
|
|
ARG BATS_VERSION
|
|
RUN cd /tmp \
|
|
&& git clone https://github.com/sstephenson/bats.git \
|
|
&& cd bats \
|
|
&& git reset --hard "${BATS_VERSION}" \
|
|
&& ./install.sh /usr/local \
|
|
&& rm -rf /tmp/bats
|
|
|
|
# install criu
|
|
ARG CRIU_VERSION
|
|
RUN mkdir -p /usr/src/criu \
|
|
&& curl -fsSL https://github.com/checkpoint-restore/criu/archive/${CRIU_VERSION}.tar.gz | tar -C /usr/src/criu/ -xz --strip-components=1 \
|
|
&& cd /usr/src/criu \
|
|
&& echo 1 > .gitid \
|
|
&& curl -sSL https://github.com/checkpoint-restore/criu/commit/4c27b3db4f4325a311d8bfa9a50ea3efb4d6e377.patch | patch -p1 \
|
|
&& curl -sSL https://github.com/checkpoint-restore/criu/commit/aac41164b2cd7f0d2047f207b32844524682e43f.patch | patch -p1 \
|
|
&& curl -sSL https://github.com/checkpoint-restore/criu/commit/6f19249b2565f3f7c0a1f8f65b4ae180e8f7f34b.patch | patch -p1 \
|
|
&& curl -sSL https://github.com/checkpoint-restore/criu/commit/378337a496ca759848180bc5411e4446298c5e4e.patch | patch -p1 \
|
|
&& make install-criu \
|
|
&& cd - \
|
|
&& rm -rf /usr/src/criu
|
|
|
|
COPY script/tmpmount /
|
|
WORKDIR /go/src/github.com/opencontainers/runc
|
|
ENTRYPOINT ["/tmpmount"]
|
|
|
|
# setup a playground for us to spawn containers in
|
|
COPY tests/integration/multi-arch.bash tests/integration/
|
|
ENV ROOTFS /busybox
|
|
RUN mkdir -p "${ROOTFS}"
|
|
RUN . tests/integration/multi-arch.bash \
|
|
&& curl -fsSL `get_busybox` | tar xfJC - "${ROOTFS}"
|
|
|
|
COPY . .
|