github.com/opencontainers/runc@v1.2.0-rc.1.0.20240520010911-492dc558cdd6/Dockerfile (about)

     1  ARG GO_VERSION=1.20
     2  ARG BATS_VERSION=v1.9.0
     3  ARG LIBSECCOMP_VERSION=2.5.5
     4  
     5  FROM golang:${GO_VERSION}-bullseye
     6  ARG DEBIAN_FRONTEND=noninteractive
     7  ARG CRIU_REPO=https://download.opensuse.org/repositories/devel:/tools:/criu/Debian_11
     8  
     9  RUN KEYFILE=/usr/share/keyrings/criu-repo-keyring.gpg; \
    10      wget -nv $CRIU_REPO/Release.key -O- | gpg --dearmor > "$KEYFILE" \
    11      && echo "deb [signed-by=$KEYFILE] $CRIU_REPO/ /" > /etc/apt/sources.list.d/criu.list \
    12      && dpkg --add-architecture i386 \
    13      && apt-get update \
    14      && apt-get install -y --no-install-recommends \
    15          build-essential \
    16          criu \
    17          gcc \
    18          gcc-multilib \
    19          curl \
    20          gawk \
    21          gperf \
    22          iptables \
    23          jq \
    24          kmod \
    25          pkg-config \
    26          python3-minimal \
    27          sshfs \
    28          sudo \
    29          uidmap \
    30          iproute2 \
    31      && apt-get install -y --no-install-recommends \
    32          libc-dev:i386 libgcc-s1:i386 \
    33          gcc-aarch64-linux-gnu libc-dev-arm64-cross \
    34          gcc-arm-linux-gnueabi libc-dev-armel-cross \
    35          gcc-arm-linux-gnueabihf libc-dev-armhf-cross \
    36          gcc-powerpc64le-linux-gnu libc-dev-ppc64el-cross \
    37          gcc-s390x-linux-gnu libc-dev-s390x-cross \
    38          gcc-riscv64-linux-gnu libc-dev-riscv64-cross \
    39      && apt-get clean \
    40      && rm -rf /var/cache/apt /var/lib/apt/lists/* /etc/apt/sources.list.d/*.list
    41  
    42  # Add a dummy user for the rootless integration tests. While runC does
    43  # not require an entry in /etc/passwd to operate, one of the tests uses
    44  # `git clone` -- and `git clone` does not allow you to clone a
    45  # repository if the current uid does not have an entry in /etc/passwd.
    46  RUN useradd -u1000 -m -d/home/rootless -s/bin/bash rootless
    47  
    48  # install bats
    49  ARG BATS_VERSION
    50  RUN cd /tmp \
    51      && git clone https://github.com/bats-core/bats-core.git \
    52      && cd bats-core \
    53      && git reset --hard "${BATS_VERSION}" \
    54      && ./install.sh /usr/local \
    55      && rm -rf /tmp/bats-core
    56  
    57  # install libseccomp
    58  ARG LIBSECCOMP_VERSION
    59  COPY script/seccomp.sh script/lib.sh /tmp/script/
    60  RUN mkdir -p /opt/libseccomp \
    61      && /tmp/script/seccomp.sh "$LIBSECCOMP_VERSION" /opt/libseccomp 386 amd64 arm64 armel armhf ppc64le riscv64 s390x
    62  ENV LIBSECCOMP_VERSION=$LIBSECCOMP_VERSION
    63  ENV LD_LIBRARY_PATH=/opt/libseccomp/lib
    64  ENV PKG_CONFIG_PATH=/opt/libseccomp/lib/pkgconfig
    65  
    66  # Prevent the "fatal: detected dubious ownership in repository" git complain during build.
    67  RUN git config --global --add safe.directory /go/src/github.com/opencontainers/runc
    68  
    69  WORKDIR /go/src/github.com/opencontainers/runc
    70  
    71  # Fixup for cgroup v2.
    72  COPY script/prepare-cgroup-v2.sh /
    73  ENTRYPOINT [ "/prepare-cgroup-v2.sh" ]