2020-08-05 14:07:37 +08:00
|
|
|
ARG GO_VERSION=1.15
|
2020-05-13 02:54:17 +08:00
|
|
|
ARG BATS_VERSION=v1.2.0
|
2020-05-03 05:13:41 +08:00
|
|
|
ARG CRIU_VERSION=v3.14
|
2020-02-23 01:43:54 +08:00
|
|
|
|
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 \
|
2020-04-11 02:00:51 +08:00
|
|
|
&& git clone https://github.com/bats-core/bats-core.git \
|
|
|
|
&& cd bats-core \
|
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 \
|
2020-04-11 02:00:51 +08:00
|
|
|
&& rm -rf /tmp/bats-core
|
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 \
|
2020-02-05 21:58:25 +08:00
|
|
|
&& echo 1 > .gitid \
|
2020-05-20 08:19:14 +08:00
|
|
|
&& make -j $(nproc) install-criu \
|
2020-02-05 21:58:25 +08:00
|
|
|
&& cd - \
|
2016-12-14 18:20:38 +08:00
|
|
|
&& rm -rf /usr/src/criu
|
2016-08-30 09:46:47 +08:00
|
|
|
|
2020-05-14 08:56:55 +08:00
|
|
|
# install skopeo
|
|
|
|
RUN echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_Unstable/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list \
|
|
|
|
&& wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/Debian_Unstable/Release.key -O- | sudo apt-key add - \
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get install -y --no-install-recommends skopeo \
|
|
|
|
&& rm -rf /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/cache/apt /var/lib/apt/lists/*;
|
|
|
|
|
|
|
|
# install umoci
|
|
|
|
RUN curl -o /usr/local/bin/umoci -fsSL https://github.com/opencontainers/umoci/releases/download/v0.4.5/umoci.amd64 \
|
|
|
|
&& chmod +x /usr/local/bin/umoci
|
|
|
|
|
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}"
|
|
|
|
|
2020-05-14 08:56:55 +08:00
|
|
|
ENV DEBIAN_ROOTFS /debian
|
|
|
|
RUN mkdir -p "${DEBIAN_ROOTFS}"
|
|
|
|
RUN . tests/integration/multi-arch.bash \
|
|
|
|
&& get_and_extract_debian "$DEBIAN_ROOTFS"
|