-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.customized
72 lines (55 loc) · 2.3 KB
/
Dockerfile.customized
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
ARG IMAGE_NAME
ARG VERSION
FROM ${IMAGE_NAME}:${VERSION} AS base
VOLUME /root/.ssh
WORKDIR /workspace
ENV LC_ALL C.UTF-8
ENV SHELL /bin/bash
# Gitlab Clone Hook Requirements
RUN apt-get update && apt-get install -y build-essential git wget curl netcat-openbsd && rm -rf /var/lib/apt/lists/*
# NOTE([email protected]): is build-essential already included at "base" image? (less size?)
# Metadata
LABEL maintainer="[email protected]"
ARG BUILD_DATE
ARG VCS_REF
ARG VCS_BRANCH
ARG VCS_DESCRIBED
ARG HOSTNAME
###################################### Customized VSCODE
# XXX: https://github.com/cdr/code-server/releases
FROM base AS vscode
WORKDIR /usr
RUN wget https://github.com/cdr/code-server/releases/download/v3.9.3/code-server-3.9.3-linux-amd64.tar.gz
RUN tar xf code-server-3.9.3-linux-amd64.tar.gz
RUN code-server-3.9.3-linux-amd64/bin/code-server --install-extension ms-python.python
WORKDIR /workspace
COPY entrypoint.vscode.sh /scripts/entrypoint.sh
RUN chmod +x /scripts/entrypoint.sh
EXPOSE 8000
CMD /scripts/entrypoint.sh
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.version=$VERSION \
ai.comcom.current-branch="$VCS_BRANCH" \
ai.comcom.current-branch-described="$VCS_DESCRIBED" \
ai.comcom.build-hostname="$HOSTNAME"
###################################### Customized JUPYTERLAB
FROM base AS jupyterlab
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get update && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/*
RUN /opt/conda/bin/pip install jupyterlab jupyterlab-git
RUN /opt/conda/bin/jupyter labextension enable
RUN /opt/conda/bin/jupyter labextension install -y @jupyterlab/git
# TODO: @jupyterlab/git frontend extension has version: 0.30.0b3 while the python package has version 0.24.0.
# https://github.com/jupyterlab/jupyterlab-git/issues/861
RUN /opt/conda/bin/pip install --upgrade jupyterlab-git
COPY entrypoint.jupyterlab.sh /scripts/entrypoint.sh
RUN chmod +x /scripts/entrypoint.sh
EXPOSE 8000
CMD /scripts/entrypoint.sh
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.version=$VERSION \
ai.comcom.current-branch="$VCS_BRANCH" \
ai.comcom.current-branch-described="$VCS_DESCRIBED" \
ai.comcom.build-hostname="$HOSTNAME"