5
5
6
6
# Non-interactive installation mode
7
7
ENV DEBIAN_FRONTEND=noninteractive
8
+ ARG TARGETPLATFORM
8
9
#Change for other python; 3.11 may be too much right now
9
10
ARG PYTHON_VER=3.11
10
11
@@ -24,12 +25,14 @@ RUN locale-gen en_US.UTF-8
24
25
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python$PYTHON_VER && \
25
26
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.8
26
27
27
- #Add gitpod user with correct UID and GID; and add him to sudoers
28
- RUN useradd -l -u 33333 -G sudo -md /home/gitpod -s /bin/bash gitpod && \
29
- echo 'gitpod:gitpod' | chpasswd && usermod -aG sudo gitpod && \
30
- sed -i.bkp -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers && \
31
- echo "gitpod ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && mkdir -p /home/gitpod/Desktop
32
- RUN wget -O code.deb https://go.microsoft.com/fwlink/?LinkID=760868 && gdebi -n code.deb && rm code.deb
28
+ # VSCode
29
+ RUN if [ "$TARGETPLATFORM" = "linux/arm64" ] ; then \
30
+ wget -O code.deb "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-arm64"; \
31
+ else \
32
+ wget -O code.deb https://go.microsoft.com/fwlink/?LinkID=760868; \
33
+ fi
34
+
35
+ RUN gdebi -n code.deb && rm code.deb
33
36
34
37
# Install graphics
35
38
RUN apt install -y xfce4 xfce4-goodies xserver-xorg-video-dummy xserver-xorg-legacy x11vnc firefox && \
@@ -54,10 +57,6 @@ RUN git clone https://github.com/novnc/noVNC.git /opt/novnc && \
54
57
git clone https://github.com/novnc/websockify /opt/novnc/utils/websockify && \
55
58
echo "<html><head><meta http-equiv=\"Refresh\" content=\"0; url=vnc.html?autoconnect=true&reconnect=true&reconnect_delay=1000&resize=scale&quality=9\"></head></html>" > /opt/novnc/index.html
56
59
57
- # Set environmental variables
58
- ENV DISPLAY=:1
59
- ENV VNC_DISPLAY=:1
60
-
61
60
# Install informative git for bash
62
61
RUN git clone https://github.com/magicmonty/bash-git-prompt.git /home/gitpod/.bash-git-prompt --depth=1
63
62
@@ -66,39 +65,44 @@ COPY additional_files/start-vnc-session.sh /usr/bin/start-vnc-session.sh
66
65
RUN chmod +x /usr/bin/start-vnc-session.sh && \
67
66
dos2unix /usr/bin/start-vnc-session.sh
68
67
69
- # Set up VSCode launcher
70
- COPY ["additional_files/Visual Studio Code.desktop", "/home/gitpod/Desktop/Visual Studio Code.desktop"]
71
- RUN chown gitpod:gitpod "/home/gitpod/Desktop/Visual Studio Code.desktop" && chmod +x "/home/gitpod/Desktop/Visual Studio Code.desktop" && \
72
- dos2unix "/home/gitpod/Desktop/Visual Studio Code.desktop"
73
-
74
68
# PyCharm
75
69
ARG PYCHARM_VER=2024.3.4
76
70
RUN cd /opt && wget https://download.jetbrains.com/python/pycharm-community-$PYCHARM_VER.tar.gz && \
77
71
tar -xvf pycharm-community-$PYCHARM_VER.tar.gz && rm pycharm-community-$PYCHARM_VER.tar.gz && \
78
72
mv pycharm-community-$PYCHARM_VER pycharm && ln -s /opt/pycharm/bin/pycharm.sh /usr/bin/pycharm && chmod +x /usr/bin/pycharm
79
73
80
-
81
- COPY ["additional_files/PyCharm.desktop", "/home/gitpod/Desktop/PyCharm.desktop"]
82
-
83
- RUN chown gitpod:gitpod "/home/gitpod/Desktop/PyCharm.desktop" && chmod +x "/home/gitpod/Desktop/PyCharm.desktop" && \
84
- dos2unix "/home/gitpod/Desktop/PyCharm.desktop"
85
-
86
74
# Manage ports
87
75
EXPOSE 5901 6080 8888 10000/tcp 10000/udp
88
76
77
+ RUN python$PYTHON_VER -m pip install --upgrade pip && python$PYTHON_VER -m pip install "numpy<2" cython open3d pybullet roboticstoolbox-python --ignore-installed
78
+ RUN python$PYTHON_VER -m pip install psutil --force-reinstall
79
+
80
+ #Add gitpod user with correct UID and GID; and add him to sudoers
81
+ RUN useradd -l -u 33333 -G sudo -md /home/gitpod -s /bin/bash gitpod && \
82
+ echo 'gitpod:gitpod' | chpasswd && usermod -aG sudo gitpod && \
83
+ sed -i.bkp -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers && \
84
+ echo "gitpod ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && mkdir -p /home/gitpod/Desktop \
85
+
89
86
RUN echo "alias vnc='export DISPLAY=\$VNC_DISPLAY'" >> /home/gitpod/.bashrc
90
87
RUN echo "export PORT=5901" >> /home/gitpod/.bashrc
88
+ USER gitpod
89
+ # Set up VSCode launcher
90
+ COPY ["additional_files/Visual Studio Code.desktop", "/home/gitpod/Desktop/Visual Studio Code.desktop"]
91
+ RUN chown gitpod:gitpod "/home/gitpod/Desktop/Visual Studio Code.desktop" && chmod +x "/home/gitpod/Desktop/Visual Studio Code.desktop" && \
92
+ dos2unix "/home/gitpod/Desktop/Visual Studio Code.desktop"
93
+ COPY ["additional_files/PyCharm.desktop", "/home/gitpod/Desktop/PyCharm.desktop"]
91
94
92
- RUN python$PYTHON_VER -m pip install --user --upgrade pip && python$PYTHON_VER -m pip install "numpy<2" cython open3d pybullet roboticstoolbox-python --ignore-installed
95
+ RUN chown gitpod:gitpod "/home/gitpod/Desktop/PyCharm.desktop" && chmod +x "/home/gitpod/Desktop/PyCharm.desktop" && \
96
+ dos2unix "/home/gitpod/Desktop/PyCharm.desktop" \
93
97
94
- USER gitpod
95
98
RUN cd /home/gitpod && git clone https://github.com/rustlluk/pyCub.git && cd pyCub && git checkout dev && python$PYTHON_VER setup.py install --user
96
- RUN python$PYTHON_VER -m pip install psutil --force-reinstall
99
+
97
100
98
101
RUN sudo ln -sf /usr/bin/python$PYTHON_VER /usr/local/bin/python && sudo ln -sf /usr/bin/python$PYTHON_VER /usr/local/bin/python3
99
102
RUN echo "export PATH=/usr/local/bin:$PATH" >> /home/gitpod/.bashrc
100
103
RUN echo "export BROWSER=/usr/bin/firefox" >> /home/gitpod/.bashrc
101
-
104
+ ENV VNC_DISPLAY=:99
105
+ ENV DISPLAY=:99
102
106
# Clean up unnecessary installation products
103
107
RUN sudo rm -Rf /var/lib/apt/lists/*
104
108
0 commit comments