code-intelligence.com/cifuzz@v0.40.0/docker/cifuzz-builder/Dockerfile (about)

     1  FROM ubuntu:20.04 AS build
     2  
     3  # Install APT packages with caching set up according to
     4  # https://docs.docker.com/engine/reference/builder/#example-cache-apt-packages
     5  RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
     6      echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
     7  RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
     8    --mount=type=cache,target=/var/lib/apt,sharing=locked \
     9      export DEBIAN_FRONTEND=noninteractive && \
    10      apt-get update && \
    11      apt-get install -y --no-install-recommends \
    12      ca-certificates \
    13      curl \
    14      clang-12 \
    15      make \
    16      libcap-dev \
    17      && rm -rf /var/lib/apt/lists/*
    18  
    19  ENV PATH="${PATH}:/usr/lib/llvm-12/bin"
    20  ENV CC=/usr/lib/llvm-12/bin/clang
    21  ENV CXX=/usr/lib/llvm-12/bin/clang++
    22  
    23  # Install Go
    24  # We cache the go source tarball in /var/cache/go-src.
    25  # We could look into ways to always install the latest Go release if we
    26  # find that we frequently have to update the Go version manually here
    27  # (which should only be necessary when we use new Go features).
    28  RUN --mount=type=cache,target=/var/cache/go-src \
    29      SHA256=$(sha256sum /var/cache/go-src/go.tar.gz | cut -d ' ' -f 1); \
    30      if [ "${SHA256:-}" != "b945ae2bb5db01a0fb4786afde64e6fbab50b67f6fa0eb6cfa4924f16a7ff1eb" ]; then \
    31        curl --fail --silent --show-error --location -o /var/cache/go-src/go.tar.gz https://go.dev/dl/go1.20.6.linux-amd64.tar.gz; \
    32      fi && \
    33      tar -C /usr/local -xzf /var/cache/go-src/go.tar.gz
    34  
    35  ENV PATH="${PATH}:/usr/local/go/bin"
    36  
    37  WORKDIR /src
    38  COPY . .
    39  RUN --mount=type=cache,target=/root/.cache/go-build \
    40      --mount=type=cache,target=/root/go/pkg/mod \
    41      make installer
    42  
    43  FROM scratch AS bin
    44  COPY --from=build /src/build/bin/cifuzz_installer_linux /