-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
75 lines (61 loc) · 2.85 KB
/
Dockerfile
File metadata and controls
75 lines (61 loc) · 2.85 KB
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
FROM ubuntu:22.04
# Define user and user id default arguments
ARG USER=student
ARG UID=1010
ARG VSCODE_SRV_DIR=/vscode
ENV VSCODE_SRV_DIR=${VSCODE_SRV_DIR}
ENV HOSTNAME=bigdatalabs
ENV SERVICE_URL=https://open-vsx.org/vscode/gallery
ENV ITEM_URL=https://open-vsx.org/vscode/item
ENV DEBIAN_FRONTEND=noninteractive
ENV CODESERVER_VERSION=4.22.0
ENV M2_HOME=/opt/apache-maven-3.9.9
ENV MAVEN_HOME=${M2_HOME}
RUN apt-get update &&\
apt-get install -y curl git wget gnupg &&\
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version=${CODESERVER_VERSION} &&\
apt-get clean
# install amazon corretto open JDK manually
# RUN apt-get install java-common
# RUN wget https://corretto.aws/downloads/latest/amazon-corretto-8-x64-linux-jdk.deb
# RUN dpkg --install amazon-corretto-8-x64-linux-jdk.deb
# install amazon corretto open JDK through apt-get
RUN wget -O - https://apt.corretto.aws/corretto.key | gpg --dearmor -o /usr/share/keyrings/corretto-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/corretto-keyring.gpg] https://apt.corretto.aws stable main" | tee /etc/apt/sources.list.d/corretto.list
RUN apt-get update; apt-get install -y java-1.8.0-amazon-corretto-jdk
# install apache maven
RUN wget https://dlcdn.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz
RUN tar -xvf apache-maven-3.9.9-bin.tar.gz
RUN mv apache-maven-3.9.9 /opt/
RUN rm apache-maven-3.9.9-bin.tar.gz
ENV PATH=${MAVEN_HOME}/bin:${PATH}
# install python and pyspark
RUN apt-get update && \
apt-get install -y python3 python3-pip python-is-python3 && \
pip3 install autopep8 pylint pyspark findspark ipython jupyterlab && \
apt-get clean
RUN useradd -ms /bin/bash -u ${UID} $USER && \
usermod -d ${VSCODE_SRV_DIR} $USER && \
mkdir -p ${VSCODE_SRV_DIR}/extensions && \
mkdir -p ${VSCODE_SRV_DIR}/data && \
# mkdir -p ${VSCODE_SRV_DIR}/workspace && \
cp /root/.bashrc ${VSCODE_SRV_DIR}/.bashrc && \
cp /root/.profile ${VSCODE_SRV_DIR}/.profile && \
echo 'alias code=code-server' >> ${VSCODE_SRV_DIR}/.bashrc && \
echo 'export PS1="\[\e]0;\u@\h: \w\a\]\[\033[0;00m\][\A]\[\033[00;00m\]\[\033[01;34m\]\u\[\033[00m\]:\[\033[01;34m\]\w\[\e[91m\]\[\033[00m\]$ "' >> ${VSCODE_SRV_DIR}/.bashrc
# COPY pylance extension
COPY ./extensions/ms-python.vscode-pylance-2024.4.1.vsix /tmp
# install vscode extensions
RUN code-server --extensions-dir ${VSCODE_SRV_DIR}/extensions \
--install-extension ms-python.python \
--install-extension ms-python.pylint \
--install-extension ms-toolsai.jupyter \
--install-extension tmp/ms-python.vscode-pylance-2024.4.1.vsix \
--install-extension vscjava.vscode-java-pack
# clean and remove pylance extension
RUN rm /tmp/ms-python.vscode-pylance-2024.4.1.vsix
RUN chown -R ${USER}:${USER} ${VSCODE_SRV_DIR}
COPY ./start.sh start.sh
RUN chmod 755 start.sh
USER ${USER}
ENTRYPOINT [ "/start.sh" ]