-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile
281 lines (245 loc) · 9.99 KB
/
dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
FROM gitpod/openvscode-server:latest
#===============================================================================
# Additions for cyverse, adapted from original vscode cyverse project
#===============================================================================
# Build-time metadata as defined at http://label-schema.org
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="CyVerse VSCode" \
org.label-schema.description="Built from GitPod Open VSCode, additional depends for CyVerse K8s workbench" \
org.label-schema.url="https://cyverse.org" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="e.g. https://github.com/cyverse-vice/vscode" \
org.label-schema.vendor="CyVerse" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0.0"
USER root
ARG DEBIAN_FRONTEND=noninteractive
# Install a few dependencies for iCommands, text editing, and monitoring instances
RUN apt-get update && \
apt-get install -y lsb-release apt-transport-https curl gnupg2 libfuse2 gettext gcc less nodejs software-properties-common apt-utils glances htop nano && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get install -y vim-nox && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get install -y emacs-nox && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN wget -qO - https://packages.irods.org/irods-signing-key.asc | apt-key add - && \
echo "deb [arch=amd64] https://packages.irods.org/apt/ $(lsb_release -sc) main" >> /etc/apt/sources.list.d/renci-irods.list && \
apt-get update && \
apt install -y irods-icommands
RUN wget -q -c \
http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb
RUN apt install -y \
python3-urllib3 \
python3-requests \
./libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb && \
rm -rf ./libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb && \
apt install -y irods-icommands && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install Go
RUN wget -q -c https://dl.google.com/go/go1.17.6.linux-amd64.tar.gz -O - | tar -xz -C /usr/local
ENV PATH=$PATH:/usr/local/go/bin
# Install Rust
RUN apt-get update && \
apt-get install -y cargo rustc
# Install CyberDuck CLI
RUN echo "deb https://s3.amazonaws.com/repo.deb.cyberduck.io stable main" | tee /etc/apt/sources.list.d/cyberduck.list > /dev/null && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FE7097963FEFBE72 && \
apt-get update && \
apt-get install duck
# Install MiniConda
ENV TZ America/Phoenix
ENV LANG=C.UTF-8
ENV LC_ALL C.UTF-8
ENV PATH /opt/conda/bin:$PATH
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone
RUN apt-get update && \
apt-get install -y wget bzip2 ca-certificates \
libglib2.0-0 libxext6 libsm6 libxrender1 \
gettext-base git mercurial subversion \
tmux && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN wget --quiet \
https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh \
-O ~/miniforge.sh && \
/bin/bash ~/miniforge.sh -b -p /opt/conda && \
rm ~/miniforge.sh && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> /home/workspace/.bashrc && \
echo ". /opt/conda/etc/profile.d/mamba.sh" >> /home/workspace/.bashrc && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> /home/workspace/.zshrc && \
echo ". /opt/conda/etc/profile.d/mamba.sh" >> /home/workspace/.zshrc && \
chown -R 1000:1000 /opt/conda
# Install GitHub CLI
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/etc/apt/trusted.gpg.d/githubcli-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list && \
apt update && \
apt install gh
COPY entry.sh /bin
RUN mkdir -p /home/workspace/.irods
RUN chown -R 1000:1000 /home/workspace/
#===============================================================================
# Download and install R and shiny server, adapted from rocker/shiny
#===============================================================================
# Add more up to date R repository and repository of cran packages
RUN apt-get update && apt-get install -y \
software-properties-common \
dirmngr && \
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc && \
add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" && \
add-apt-repository "ppa:c2d4u.team/c2d4u4.0+"
# Install R and R shiny package
RUN apt-get update && apt-get install -y \
r-base \
r-cran-shiny
# Installing shiny server
RUN apt-get update && apt-get install -y \
gdebi-core \
pandoc \
pandoc-citeproc \
libcurl4-gnutls-dev \
libcairo2-dev \
libxt-dev \
xtail
RUN wget --no-verbose https://download3.rstudio.org/ubuntu-18.04/x86_64/VERSION -O "version.txt" && \
VERSION=$(cat version.txt) && \
wget --no-verbose "https://download3.rstudio.org/ubuntu-18.04/x86_64/shiny-server-$VERSION-amd64.deb" -O ss-latest.deb && \
gdebi -n ss-latest.deb && \
rm -f version.txt ss-latest.deb && \
. /etc/environment && \
chown shiny:shiny /var/lib/shiny-server
EXPOSE 3838
COPY shiny-server.sh /usr/bin/shiny-server.sh
CMD ["/usr/bin/shiny-server.sh"]
#===============================================================================
# Build Geospatial, list taken from js2-jupyterhub
#===============================================================================
RUN apt-get update && \
apt install -y \
gdal-bin \
lbzip2 \
libfftw3-dev \
libgdal-dev \
libgeos-dev \
libgsl0-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libhdf4-alt-dev \
libhdf5-dev \
libjq-dev \
libpq-dev \
libproj-dev \
libprotobuf-dev \
libnetcdf-dev \
libsqlite3-dev \
libssl-dev \
libudunits2-dev \
lsb-release \
netcdf-bin \
postgis \
protobuf-compiler \
sqlite3 \
tk-dev \
unixodbc \
unixodbc-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*
#===============================================================================
# Additional R packages (not from conda/mamba)
#===============================================================================
# Install some useful cran packages
RUN apt-get update && apt-get install -y \
r-cran-devtools \
r-cran-caret \
r-cran-crayon \
r-cran-irkernel \
r-cran-curl \
r-cran-rodbc \
r-cran-rsqlite \
r-cran-duckdb \
r-cran-tidyverse \
r-cran-rmarkdown \
r-cran-cairo
# Some dependancies for R vscode extension that are not in the repos
RUN R -e "install.packages(c('languageserver', 'httpgd', 'lintr'))"
#===============================================================================
# Dotnet Install
#===============================================================================
# Install dotnet 8 from ubuntu repos
RUN sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-8.0
#===============================================================================
# Installing Jupyter (not from conda/mamba)
#===============================================================================
RUN apt-get update && apt-get install -y \
jupyter
#===============================================================================
# to restore permissions for the web interface
#===============================================================================
USER openvscode-server
#===============================================================================
# install R packages via conda
#===============================================================================
RUN mamba install --quiet --yes \
'r-base' \
'r-shiny' \
'gcc_linux-64' \
'gxx_linux-64' \
'gfortran_linux-64' \
'r-rcpp' \
'r-devtools' \
'r-caret' \
'r-crayon' \
'r-irkernel' \
'r-rcurl' \
'r-rodbc' \
'r-rsqlite' \
'r-duckdb' \
'r-tidyverse' \
'r-rmarkdown' \
'r-cairo' \
'r-languageserver' \
'r-httpgd' \
'r-lintr' \
'unixodbc' && \
conda clean --all -f -y
#===============================================================================
# Setup Dotnet to work with jupyter notebooks
#===============================================================================
# Install dotnet interactive
RUN dotnet tool install -g Microsoft.dotnet-interactive
ENV PATH $PATH:/home/workspace/.dotnet/tools
# Install jupyter and Python in conda
RUN mamba install --quiet --yes \
'jupyter' \
'ipykernel' && \
conda clean --all -f -y
# Register dotnet kernals with jupyterlab
RUN dotnet interactive jupyter install
RUN python -m ipykernel install --user --name=python3
#===============================================================================
# Install vscode extensions by default
#===============================================================================
ENV OPENVSCODE_SERVER_ROOT="/home/.openvscode-server"
ENV OPENVSCODE="${OPENVSCODE_SERVER_ROOT}/bin/openvscode-server"
RUN ${OPENVSCODE} --install-extension "GitHub.vscode-pull-request-github"
RUN ${OPENVSCODE} --install-extension "ms-toolsai.jupyter"
RUN ${OPENVSCODE} --install-extension "REditorSupport.r"
RUN ${OPENVSCODE} --install-extension "ms-python.python"
RUN ${OPENVSCODE} --install-extension "rust-lang.rust-analyzer"
RUN ${OPENVSCODE} --install-extension "golang.Go"
RUN ${OPENVSCODE} --install-extension "muhammad-sammy.csharp"
RUN ${OPENVSCODE} --install-extension "Ionide.Ionide-fsharp"
#===============================================================================
# Create entry point
#===============================================================================
ENTRYPOINT ["bash", "/bin/entry.sh"]