| 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 \ |
| software-properties-common \ |
| && git lfs install \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml |
|
|
| |
| WORKDIR /home/ |
|
|
| |
| ENV USERNAME=user \ |
| USER_UID=1000 \ |
| USER_GID=1000 \ |
| LANG=C.UTF-8 \ |
| LC_ALL=C.UTF-8 \ |
| NVIDIA_VISIBLE_DEVICES=all \ |
| NVIDIA_DRIVER_CAPABILITIES=all \ |
| EDITOR=code \ |
| VISUAL=code \ |
| GIT_EDITOR="code --wait" \ |
| OPENVSCODE_SERVER_ROOT=/home/.vscode \ |
| OPENVSCODE=/home/.vscode/bin/openvscode-server \ |
| PATH="/home/user/.local/bin:$PATH" |
|
|
| |
| RUN RELEASE_TAG=$(curl -sX GET "https://api.github.com/repos/gitpod-io/openvscode-server/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]') && \ |
| arch=$(uname -m) && \ |
| if [ "${arch}" = "x86_64" ]; then \ |
| arch="x64"; \ |
| elif [ "${arch}" = "aarch64" ]; then \ |
| arch="arm64"; \ |
| elif [ "${arch}" = "armv7l" ]; then \ |
| arch="armhf"; \ |
| fi && \ |
| wget https://github.com/gitpod-io/openvscode-server/releases/download/${RELEASE_TAG}/${RELEASE_TAG}-linux-${arch}.tar.gz && \ |
| tar -xzf ${RELEASE_TAG}-linux-${arch}.tar.gz && \ |
| mv ${RELEASE_TAG}-linux-${arch} ${OPENVSCODE_SERVER_ROOT} && \ |
| cp ${OPENVSCODE_SERVER_ROOT}/bin/remote-cli/openvscode-server ${OPENVSCODE_SERVER_ROOT}/bin/remote-cli/code && \ |
| rm -f ${RELEASE_TAG}-linux-${arch}.tar.gz |
| |
| |
| RUN install -d -m 0755 /etc/apt/keyrings && \ |
| wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | tee /etc/apt/keyrings/packages.mozilla.org.asc > /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 |
|
|
| |
| RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.34.0/geckodriver-v0.34.0-linux64.tar.gz && \ |
| tar -xvzf geckodriver-v0.34.0-linux64.tar.gz && \ |
| sudo mv geckodriver /usr/local/bin/ && \ |
| sudo chmod +x /usr/local/bin/geckodriver && \ |
| geckodriver --version |
| |
| |
| RUN curl -sSL https://pdm-project.org/install-pdm.py | python3 - |
|
|
| |
| WORKDIR /home/user/ |
|
|
| |
| 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 |
|
|
| |
| RUN yes | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
|
|
| |
| RUN ${OPENVSCODE} --install-extension ms-python.python && \ |
| ${OPENVSCODE} --install-extension monokai.theme-monokai-pro-vscode |
|
|
| |
| COPY requirements.txt . |
| RUN 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"] |