# Use Ubuntu 22.04 as the base image FROM ubuntu:22.04 # Set environment variables to non-interactive ENV DEBIAN_FRONTEND=noninteractive # Update package lists and install necessary tools RUN apt-get update && apt-get install -y \ apt-utils \ wget \ && apt-get clean # Update the package list and install dependencies for building Python from source RUN apt-get update && \ apt-get install -y \ build-essential \ wget \ libssl-dev \ zlib1g-dev \ libncurses5-dev \ libnss3-dev \ libsqlite3-dev \ libreadline-dev \ libffi-dev \ curl \ libbz2-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Download Python 3.10.12 source code RUN wget https://www.python.org/ftp/python/3.10.12/Python-3.10.12.tgz && \ tar -xvf Python-3.10.12.tgz # Build and install Python 3.10.12 from source WORKDIR Python-3.10.12 RUN ./configure --enable-optimizations && \ make -j$(nproc) && \ make altinstall # Verify the Python installation RUN python3.10 --version CMD ["bash"] # Set Python 3.10.12 as the default Python RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3.10 1 RUN apt-get update && \ apt-get install -y git tree vim #CMD ["/lsb_release"] # Create a directory to store downloaded packages RUN mkdir -p /downloads/info/tools # Set working directory WORKDIR /app ## Set Python3 as the default python command #RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 # RUN apt-offline set ~/apt-offline.sig RUN mkdir -p /downloads/shared_downloads_dir RUN mkdir /libraries WORKDIR /libraries #RUN git clone https://bitbucket.wrs.com/scm/ct/cdad-generator.git /libraries #COPY ./mydev/libraries/* /libraries/ # List the contents of the download directory RUN ls -l /downloads # Set the working directory WORKDIR /downloads # copy the packages into the container COPY ./downloaded_packages/*deb /downloads COPY ./info/ /downloads/info/ COPY ./info_fromDocker/ /downloads/info_fromDocker/ COPY ./clones/ /downloads/clones/ #WORKDIR /downloads/info/tools #RUN /bin/bash ./install_co_libraries.sh # # Set entrypoint (optional) CMD ["bash"]