2020-02-23 01:43:54 +08:00
|
|
|
ARG GO_VERSION=1.13
|
|
|
|
ARG BATS_VERSION=03608115df2071fff4eaaff1605768c275e5f81f
|
|
|
|
ARG CRIU_VERSION=v3.12
|
|
|
|
|
2020-02-24 04:42:55 +08:00
|
|
|
FROM golang:${GO_VERSION}-buster
|
2020-02-23 01:44:49 +08:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
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 \
|
2020-02-23 08:01:29 +08:00
|
|
|
&& 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 \
|
2020-02-24 04:42:55 +08:00
|
|
|
libprotobuf-c-dev \
|
2020-02-23 08:01:29 +08:00
|
|
|
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/*;
|
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
|
2020-02-23 01:43:54 +08:00
|
|
|
ARG BATS_VERSION
|
2016-08-30 09:46:47 +08:00
|
|
|
RUN cd /tmp \
|
|
|
|
&& git clone https://github.com/sstephenson/bats.git \
|
|
|
|
&& cd bats \
|
2020-02-23 01:43:54 +08:00
|
|
|
&& git reset --hard "${BATS_VERSION}" \
|
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
|
2020-02-23 01:43:54 +08:00
|
|
|
ARG CRIU_VERSION
|
2016-08-30 09:46:47 +08:00
|
|
|
RUN mkdir -p /usr/src/criu \
|
2020-03-21 08:19:01 +08:00
|
|
|
&& curl -fsSL https://github.com/checkpoint-restore/criu/archive/${CRIU_VERSION}.tar.gz | tar -C /usr/src/criu/ -xz --strip-components=1 \
|
2016-08-30 09:46:47 +08:00
|
|
|
&& cd /usr/src/criu \
|
2016-12-14 18:20:38 +08:00
|
|
|
&& make install-criu \
|
|
|
|
&& rm -rf /usr/src/criu
|
2016-08-30 09:46:47 +08:00
|
|
|
|
|
|
|
COPY script/tmpmount /
|
|
|
|
WORKDIR /go/src/github.com/opencontainers/runc
|
|
|
|
ENTRYPOINT ["/tmpmount"]
|
|
|
|
|
2020-02-23 08:09:59 +08:00
|
|
|
# setup a playground for us to spawn containers in
|
|
|
|
COPY tests/integration/multi-arch.bash tests/integration/
|
|
|
|
ENV ROOTFS /busybox
|
|
|
|
RUN mkdir -p "${ROOTFS}"
|
2017-11-07 10:36:56 +08:00
|
|
|
RUN . tests/integration/multi-arch.bash \
|
2020-02-23 08:09:59 +08:00
|
|
|
&& curl -fsSL `get_busybox` | tar xfJC - "${ROOTFS}"
|
|
|
|
|
|
|
|
COPY . .
|