| FROM debian:bullseye |
| |
| # Prepare the image. |
| ENV DEBIAN_FRONTEND noninteractive |
| |
| # Google Cloud SDK pre requisites. |
| RUN apt-get update && apt-get install -y -qq --no-install-recommends apt-transport-https \ |
| ca-certificates gnupg curl |
| |
| ARG TARGETARCH |
| |
| RUN cd $(mktemp -d) && curl -L -O "https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v2.1.22/docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz" && \ |
| tar xvf "docker-credential-gcr_linux_$TARGETARCH-2.1.22.tar.gz" && \ |
| mv docker-credential-gcr /usr/bin/ && rm -r $(pwd) |
| |
| # Install the Google Cloud SDK. |
| ENV HOME / |
| ENV CLOUDSDK_PYTHON_SITEPACKAGES 1 |
| RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] \ |
| https://packages.cloud.google.com/apt cloud-sdk main" | \ |
| tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ |
| curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \ |
| gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \ |
| apt-get update && apt-get -y -qq install google-cloud-sdk && apt-get clean |
| |
| # Various networking and other tools. net-tools installs arp, netstat, etc. |
| RUN apt-get install -u -qq vim \ |
| net-tools netcat ipset conntrack inetutils-traceroute bridge-utils \ |
| ebtables iputils-ping traceroute tcpdump \ |
| && apt-get clean |
| |
| # These packages are required or extracting source tarballs and building the kernel. |
| RUN apt-get update && \ |
| apt-get install -u -qq \ |
| xz-utils make gcc python3-minimal bc libelf-dev libssl-dev \ |
| bison flex dwarves libdw1 binutils && \ |
| apt-get clean |
| |
| RUN BUILD_DEPS="binutils-dev bison gawk \ |
| flex zlib1g-dev libncurses5-dev liblzo2-dev libsnappy-dev \ |
| make wget git texinfo g++" \ |
| && apt-get install -y $BUILD_DEPS \ |
| && curl -L -O https://github.com/crash-utility/crash/archive/refs/tags/8.0.4.tar.gz \ |
| && tar xf 8.0.4.tar.gz && make -j$(nproc) -C crash-8.0.4 \ |
| && make -C crash-8.0.4 extensions \ |
| && mkdir -p /usr/lib/crash/extensions \ |
| && cp -f crash-8.0.4/crash /usr/bin/crash \ |
| && cp -f crash-8.0.4/extensions/*.so /usr/lib/crash/extensions/ \ |
| && strip /usr/bin/crash /usr/lib/crash/extensions/*.so \ |
| && rm -rf 8.0.4.tar.gz crash-8.0.4 \ |
| && apt-get purge -y --auto-remove $BUILD_DEPS |
| |
| COPY cos-kernel /usr/local/bin |
| |
| VOLUME ["/.config"] |
| |
| CMD ["/bin/bash"] |