Download Dockerfile from wkplhc/vscode: direct link, hf CLI and curl.
- Browser
- Download file 1.61 kB
-
https://huggingface.co/spaces/wkplhc/vscode/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/wkplhc/vscode/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/wkplhc/vscode/resolve/main/Dockerfile
1.61 kB
| FROM ubuntu:20.04 | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| TZ=Etc/UTC | |
| RUN apt-get update && apt-get install -y \ | |
| curl \ | |
| ca-certificates \ | |
| sudo \ | |
| git \ | |
| bzip2 \ | |
| libx11-6 \ | |
| python3 \ | |
| python3-pip \ | |
| build-essential \ | |
| vim \ | |
| wget \ | |
| unzip \ | |
| jq \ | |
| tree \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Node.js and npm | |
| RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ | |
| apt-get install -y nodejs && \ | |
| npm install -g yarn | |
| ARG CODE_RELEASE | |
| RUN curl -s https://api.github.com/repos/gitpod-io/openvscode-server/releases/latest | \ | |
| grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}' | \ | |
| { read CODE_RELEASE; \ | |
| mkdir -p /app/openvscode-server && \ | |
| curl -o /tmp/openvscode-server.tar.gz -L "https://github.com/gitpod-io/openvscode-server/releases/download/${CODE_RELEASE}/${CODE_RELEASE}-linux-x64.tar.gz" && \ | |
| tar xf /tmp/openvscode-server.tar.gz -C /app/openvscode-server/ --strip-components=1; } \ | |
| && rm -f /tmp/openvscode-server.tar.gz | |
| # Create a non-root user | |
| RUN useradd -m user && echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user | |
| USER user | |
| ENV HOME=/home/user | |
| RUN mkdir -p $HOME/.config $HOME/app | |
| WORKDIR $HOME/app | |
| # Install VS Code extensions as user | |
| RUN /app/openvscode-server/bin/openvscode-server --install-extension ms-python.python \ | |
| && /app/openvscode-server/bin/openvscode-server --install-extension ms-vscode.vscode-typescript-tslint-plugin | |
| EXPOSE 7860 | |
| CMD ["/app/openvscode-server/bin/openvscode-server", "--host", "0.0.0.0", "--port", "7860", "--without-connection-token"] |