diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..be77ba3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,70 @@ +# Use the official Ubuntu 22.04 base image +ARG UBUNTU_VERSION=22.04 +FROM ubuntu:${UBUNTU_VERSION} + +# Set environment variables to avoid interactive installation prompts +ARG DEBIAN_FRONTEND=noninteractive +ARG TZ=UTC + +# Update +RUN apt-get update + +# Install required packages +RUN apt-get install -y \ + software-properties-common \ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg \ + lsb-release \ + tzdata \ + git \ + jq \ + curl \ + # Dev tools + build-essential \ + zlib1g-dev \ + libncurses5-dev \ + libgdbm-dev \ + libnss3-dev \ + libssl-dev \ + libreadline-dev \ + libffi-dev \ + libsqlite3-dev \ + wget \ + libbz2-dev && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Set Python version as an argument +ARG PYTHON_VERSION=3.11.3 +# Install Python with specified version +RUN mkdir /tmp/python_env/ && \ + cd /tmp/python_env/ && \ + wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \ + tar -xf Python-${PYTHON_VERSION}.tgz && \ + cd Python-${PYTHON_VERSION} && \ + ./configure --enable-optimizations && \ + make -j$(nproc) && \ + make install && \ + cd / && \ + rm -rf /tmp/python_env/ + +# Install pip for Python 3.11 +RUN curl -k https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ + python3.11 get-pip.py && \ + rm get-pip.py + +# Cleanup +RUN apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Reset environment variables +ENV DEBIAN_FRONTEND teletype +ENV TZ="" + +# Set the working directory +WORKDIR /root + +# Define the default command to run when the container starts +CMD ["/bin/bash"] diff --git a/README.md b/README.md index f49c769..0207b8b 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,42 @@ Before you begin, make sure you have [Docker](https://docs.docker.com/engine/install/) installed. It's also beneficial to have a basic understanding of Docker concepts. +## How to Build + +1. **Clone the Repository:** + + ```bash + git clone https://github.com/your-username/devops-toolkit.git + ``` + +2. **Navigate to the Repository:** + + ```bash + cd devops-toolkit + ``` + +3. **Navigate to the Repository:** + + ```bash + docker build -t devops-toolkit:latest . + ``` + +4. **Run the Docker Image (Optional):** + +- Start container + + ```bash + docker run -it --rm devops-toolkit + ``` + +- Check python version + + ```bash + docker run --rm devops-toolkit python3 --version + ``` + + + ## Contributing - See: [CONTRIBUTING.md](./CONTRIBUTING.md) diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md new file mode 100644 index 0000000..2be2b9a --- /dev/null +++ b/docs/TROUBLESHOOTING.md @@ -0,0 +1 @@ +- https://stackoverflow.com/questions/62154016/docker-on-wsl2-very-slow