Skip to content

Instantly share code, notes, and snippets.

@anchitj
Created May 26, 2023 08:27
Show Gist options
  • Save anchitj/cc6d88458852ad5a0d23a43a12ee84a5 to your computer and use it in GitHub Desktop.
Save anchitj/cc6d88458852ad5a0d23a43a12ee84a5 to your computer and use it in GitHub Desktop.
C2
# Use the official Ubuntu base image
FROM ubuntu:latest
# Set environment variables
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
# Install necessary packages and update the package index in a single RUN command
RUN apt-get update -y && \
apt-get install -y software-properties-common wget iputils-ping dnsutils traceroute build-essential && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get update -y && \
apt-get install -y --no-install-recommends python3.8 python3-pip zsh tzdata krb5-user curl gcc g++ git make libpthread-stubs0-dev zlib1g-dev libssl-dev libsasl2-dev libzstd-dev libcurl4-openssl-dev libsasl2-modules-gssapi-mit gdb && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Create a symlink for python to python3
RUN ln -sf /usr/bin/python3 /usr/bin/python
# Install the confluent-kafka-python package using pip
RUN pip3 install --no-cache-dir confluent-kafka
# Install Go
RUN apt-get update -y && \
apt-get install -y golang && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install .NET SDK and .NET Runtime
RUN wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
apt-get update -y && \
apt-get install -y dotnet-sdk-6.0 dotnet-runtime-6.0 && \
rm packages-microsoft-prod.deb && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install librdkafka and its development files
RUN apt-get update -y && \
apt-get install -y librdkafka-dev librdkafka1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Create workspace directory and clone librdkafka
RUN mkdir /workspace && \
git clone https://github.com/confluentinc/librdkafka.git /workspace/librdkafka
# Update the package list and install necessary packages
RUN apt-get update && apt-get install -y \
software-properties-common \
wget \
apt-transport-https \
ca-certificates \
gnupg
RUN wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add - && \
add-apt-repository --yes https://packages.adoptium.net/artifactory/deb
# Install Java (Replace '11' with your desired Java version)
RUN apt-get update && apt-get install -y temurin-11-jdk
# Set the JAVA_HOME environment variable
ENV JAVA_HOME /usr/lib/jvm/temurin-11-amd64
RUN ln -sf /usr/bin/python3 /usr/bin/python
# Set the default shell to Zsh
SHELL ["/bin/zsh", "-c"]
CMD sleep infinity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment