FROM nvidia/cuda:12.2.0-devel-ubuntu22.04 ENV DEBIAN_FRONTEND=noninteractive RUN apt update && \ apt install -y --no-install-recommends \ curl \ git \ git-lfs \ libatomic1 \ locales \ man \ nano \ net-tools \ netcat \ openssh-client \ python3 \ python3-pip \ python3-venv \ sudo \ vim \ wget \ zsh \ zip \ unzip \ ffmpeg \ imagemagick \ build-essential \ libssl-dev \ libffi-dev \ python3-dev \ libblas-dev \ liblapack-dev \ gfortran \ libsndfile1 \ libespeak-ng1 \ libportaudio2 \ libportaudiocpp0 \ portaudio19-dev \ libsndfile1-dev \ && git lfs install \ && rm -rf /var/lib/apt/lists/* # Fix ImageMagick policy RUN sed -i '/ /dev/null && \ echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null && \ echo 'Package: *\nPin: origin packages.mozilla.org\nPin-Priority: 1000' | sudo tee /etc/apt/preferences.d/mozilla && \ sudo apt-get update && sudo apt-get install -y firefox # Download and install latest GeckoDriver RUN GECKO_LATEST=$(curl -sL https://api.github.com/repos/mozilla/geckodriver/releases/latest | grep tag_name | cut -d '"' -f 4) && \ wget https://github.com/mozilla/geckodriver/releases/download/${GECKO_LATEST}/geckodriver-${GECKO_LATEST}-linux64.tar.gz && \ tar -xvzf geckodriver-${GECKO_LATEST}-linux64.tar.gz && \ sudo mv geckodriver /usr/local/bin/ && \ sudo chmod +x /usr/local/bin/geckodriver && \ rm geckodriver-${GECKO_LATEST}-linux64.tar.gz && \ geckodriver --version WORKDIR /home/user/ # Creating the user and usergroup RUN groupadd --gid ${USER_GID} ${USERNAME} \ && useradd --uid ${USER_UID} --gid ${USERNAME} -m -s /bin/bash ${USERNAME} \ && echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} \ && chmod 0440 /etc/sudoers.d/${USERNAME} RUN chmod g+rw /home && \ chown -R ${USERNAME}:${USERNAME} ${OPENVSCODE_SERVER_ROOT} && \ chown -R ${USERNAME}:${USERNAME} /home/${USERNAME} USER $USERNAME # Install oh-my-zsh & Init RUN yes | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" # Install VSCode Extensions RUN ${OPENVSCODE} --install-extension ms-python.python && \ ${OPENVSCODE} --install-extension monokai.theme-monokai-pro-vscode # Install python packages COPY requirements.txt . RUN pip install --upgrade pip && \ pip install --no-cache-dir -r requirements.txt && \ rm -rf requirements.txt ENTRYPOINT ["/bin/sh", "-c", "exec $OPENVSCODE --host 0.0.0.0 --port 7860 --without-connection-token"]