not-lain commited on
Commit
36609c9
1 Parent(s): e1b557f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -127
Dockerfile CHANGED
@@ -1,134 +1,20 @@
1
- FROM nvidia/cuda:11.3.1-base-ubuntu20.04
2
-
3
- ENV DEBIAN_FRONTEND=noninteractive \
4
- TZ=Europe/Paris
5
-
6
- # Remove any third-party apt sources to avoid issues with expiring keys.
7
- # Install some basic utilities
8
- RUN rm -f /etc/apt/sources.list.d/*.list && \
9
- apt-get update && apt-get install -y \
10
- curl \
11
- ca-certificates \
12
- sudo \
13
- git \
14
- git-lfs \
15
- zip \
16
- unzip \
17
- htop \
18
- bzip2 \
19
- libx11-6 \
20
- build-essential \
21
- libsndfile-dev \
22
- software-properties-common \
23
- && rm -rf /var/lib/apt/lists/*
24
-
25
- ARG BUILD_DATE
26
- ARG VERSION
27
- ARG CODE_RELEASE
28
- RUN \
29
- echo "**** install openvscode-server runtime dependencies ****" && \
30
- apt-get update && \
31
- apt-get install -y \
32
- jq \
33
- libatomic1 \
34
- nano \
35
- net-tools \
36
- netcat && \
37
- echo "**** install openvscode-server ****" && \
38
- if [ -z ${CODE_RELEASE+x} ]; then \
39
- CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/gitpod-io/openvscode-server/releases/latest" \
40
- | awk '/tag_name/{print $4;exit}' FS='[""]' \
41
- | sed 's|^openvscode-server-v||'); \
42
- fi && \
43
- mkdir -p /app/openvscode-server && \
44
- curl -o \
45
- /tmp/openvscode-server.tar.gz -L \
46
- "https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v${CODE_RELEASE}/openvscode-server-v${CODE_RELEASE}-linux-x64.tar.gz" && \
47
- tar xf \
48
- /tmp/openvscode-server.tar.gz -C \
49
- /app/openvscode-server/ --strip-components=1 && \
50
- echo "**** clean up ****" && \
51
- apt-get clean && \
52
- rm -rf \
53
- /tmp/* \
54
- /var/lib/apt/lists/* \
55
- /var/tmp/*
56
- COPY root/ /
57
-
58
- RUN add-apt-repository ppa:flexiondotorg/nvtop && \
59
- apt-get upgrade -y && \
60
- apt-get install -y --no-install-recommends nvtop
61
-
62
- RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
63
- apt-get install -y nodejs && \
64
- npm install -g configurable-http-proxy
65
-
66
- # Create a working directory
67
- WORKDIR /app
68
-
69
- # Create a non-root user and switch to it
70
- RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
71
- && chown -R user:user /app
72
- RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
73
- USER user
74
-
75
- # All users can use /home/user as their home directory
76
- ENV HOME=/home/user
77
- RUN mkdir $HOME/.cache $HOME/.config \
78
- && chmod -R 777 $HOME
79
-
80
- # Set up the Conda environment
81
- ENV CONDA_AUTO_UPDATE_CONDA=false \
82
- PATH=$HOME/miniconda/bin:$PATH
83
- RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
84
- && chmod +x ~/miniconda.sh \
85
- && ~/miniconda.sh -b -p ~/miniconda \
86
- && rm ~/miniconda.sh \
87
- && conda clean -ya
88
-
89
- WORKDIR $HOME/app
90
-
91
- #######################################
92
- # Start root user section
93
- #######################################
94
 
95
  USER root
96
 
97
- # User Debian packages
98
- ## Security warning : Potential user code executed as root (build time)
99
- RUN --mount=target=/root/packages.txt,source=packages.txt \
100
- apt-get update && \
101
- xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends \
102
- && rm -rf /var/lib/apt/lists/*
103
-
104
- RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
105
- bash /root/on_startup.sh
106
-
107
- RUN mkdir /data && chown user:user /data
108
-
109
- #######################################
110
- # End root user section
111
- #######################################
112
-
113
- USER user
114
-
115
- # Python packages
116
- RUN --mount=target=requirements.txt,source=requirements.txt \
117
- pip install --no-cache-dir --upgrade -r requirements.txt
118
-
119
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
120
- COPY --chown=user . $HOME/app
121
 
122
- RUN chmod +x start_server.sh
 
 
123
 
124
- ENV PYTHONUNBUFFERED=1 \
125
- GRADIO_ALLOW_FLAGGING=never \
126
- GRADIO_NUM_PORTS=1 \
127
- GRADIO_SERVER_NAME=0.0.0.0 \
128
- GRADIO_THEME=huggingface \
129
- SYSTEM=spaces \
130
- SHELL=/bin/bash
131
 
132
- EXPOSE 7860 3000
133
 
134
- CMD ["./start_server.sh"]
 
1
+ FROM gitpod/openvscode-server:latest
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  USER root
4
 
5
+ RUN apt-get update -y && apt-get upgrade -y && apt-get install -y sudo && apt-get install -y python3-pip && pip3 install --upgrade pip
6
+ RUN apt-get install -y curl gnupg wget htop sudo git git-lfs software-properties-common build-essential libgl1 zip unzip
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
+ RUN add-apt-repository ppa:flexiondotorg/nvtop
9
+ RUN apt-get upgrade -y
10
+ RUN apt-get install -y nvtop
11
 
12
+ RUN pip3 install pandas scipy matplotlib && \
13
+ pip3 install ipywidgets && \
14
+ pip3 install torch torchvision torchaudio
15
+
16
+ USER openvscode-server
 
 
17
 
18
+ EXPOSE 7860
19
 
20
+ ENTRYPOINT [ "/bin/sh", "-c", "exec ${OPENVSCODE_SERVER_ROOT}/bin/openvscode-server --host 0.0.0.0 --port 7860 --without-connection-token \"${@}\"", "--" ]