FROM nvidia/cuda:12.2.0-devel-ubuntu22.04 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 \ && git lfs install \ && rm -rf /var/lib/apt/lists/* # Fix ImageMagick policy RUN sed -i '/ /dev/null && \ gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | awk '/pub/{getline; gsub(/^ +| +$/,""); if($0 == "35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3") print "\nThe key fingerprint matches ("$0").\n"; else print "\nVerification failed: the fingerprint ("$0") does not match the expected one.\n"}' && \ echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null && \ echo 'Package: *\nPin: origin packages.mozilla.org\nPin-Priority: 1000\n' | tee /etc/apt/preferences.d/mozilla && \ apt-get update && \ apt-get install -y firefox # Download and install latest GeckoDriver RUN GECKO_DRIVER_VERSION=$(curl -sS 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_DRIVER_VERSION}/geckodriver-${GECKO_DRIVER_VERSION}-linux64.tar.gz && \ tar -xvzf geckodriver-${GECKO_DRIVER_VERSION}-linux64.tar.gz && \ sudo mv geckodriver /usr/local/bin/ && \ sudo chmod +x /usr/local/bin/geckodriver && \ rm geckodriver-${GECKO_DRIVER_VERSION}-linux64.tar.gz && \ geckodriver --version # Install latest Chrome (headless) RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list && \ apt-get update && \ apt-get install -y google-chrome-stable && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* # Download and install latest ChromeDriver RUN CHROME_DRIVER_VERSION=$(curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE) && \ wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip && \ unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/ && \ rm /tmp/chromedriver.zip && \ chmod +x /usr/local/bin/chromedriver 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"]