github.com/containerd/containerd@v22.0.0-20200918172823-438c87b8e050+incompatible/contrib/Dockerfile.test (about)

     1  # This dockerfile is used to test containerd within a container
     2  #
     3  # usage:
     4  # 1.) docker build -t containerd-test -f Dockerfile.test ../
     5  # 2.) docker run -it --privileged -v /tmp:/tmp --tmpfs /var/lib/containerd-test containerd-test  bash
     6  # 3.) $ make binaries install test
     7  #
     8  
     9  ARG GOLANG_VERSION=1.15.2
    10  
    11  FROM golang:${GOLANG_VERSION} AS golang-base
    12  RUN mkdir -p /go/src/github.com/containerd/containerd
    13  WORKDIR /go/src/github.com/containerd/containerd
    14  
    15  # Install proto3
    16  FROM golang-base AS proto3
    17  RUN apt-get update && apt-get install -y \
    18     autoconf \
    19     automake \
    20     g++ \
    21     libtool \
    22     unzip \
    23   --no-install-recommends
    24  
    25  COPY script/setup/install-protobuf install-protobuf
    26  RUN ./install-protobuf
    27  
    28  # Install runc
    29  FROM golang-base AS runc
    30  RUN apt-get update && apt-get install -y \
    31      curl \
    32      libseccomp-dev \
    33    --no-install-recommends
    34  
    35  COPY vendor.conf vendor.conf
    36  COPY script/setup/install-runc install-runc
    37  ARG GOPROXY=direct
    38  ARG GO111MODULE=off
    39  RUN ./install-runc
    40  
    41  FROM golang-base AS dev
    42  RUN apt-get update && apt-get install -y \
    43      libbtrfs-dev \
    44      btrfs-progs \
    45      gcc \
    46      git \
    47      libseccomp-dev \
    48      make \
    49      xfsprogs \
    50    --no-install-recommends
    51  
    52  COPY --from=proto3 /usr/local/bin/protoc     /usr/local/bin/protoc
    53  COPY --from=proto3 /usr/local/include/google /usr/local/include/google
    54  COPY --from=runc   /usr/local/sbin/runc      /usr/local/go/bin/runc
    55  
    56  COPY . .