Skip to content

Commit

Permalink
Merge pull request yuvipanda#13 from consideRatio/pr/refactor-dockerfile
Browse files Browse the repository at this point in the history
Remove apt.txt and refactor Dockerfile
  • Loading branch information
yuvipanda authored Jan 14, 2023
2 parents 24a2568 + a9fc17b commit 8f5b964
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 32 deletions.
51 changes: 28 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
FROM jupyter/base-notebook:python-3.7.6

FROM jupyter/base-notebook

USER root

RUN apt-get -y update \
&& apt-get install -y dbus-x11 \
firefox \
xfce4 \
xfce4-panel \
xfce4-session \
xfce4-settings \
xorg \
xubuntu-icon-theme
RUN apt-get -y -q update \
&& apt-get -y -q upgrade \
&& apt-get -y -q install \
dbus-x11 \
firefox \
xfce4 \
xfce4-panel \
xfce4-session \
xfce4-settings \
xorg \
xubuntu-icon-theme \
# chown $HOME to workaround that the xorg installation creates a
# /home/jovyan/.cache directory owned by root
&& chown -R $NB_UID:$NB_GID $HOME \
&& rm -rf /var/lib/apt/lists/*

# Remove light-locker to prevent screen lock
# Install TurboVNC (https://github.com/TurboVNC/turbovnc)
ARG TURBOVNC_VERSION=2.2.6
RUN wget -q "https://sourceforge.net/projects/turbovnc/files/${TURBOVNC_VERSION}/turbovnc_${TURBOVNC_VERSION}_amd64.deb/download" -O turbovnc_${TURBOVNC_VERSION}_amd64.deb && \
apt-get install -y -q ./turbovnc_${TURBOVNC_VERSION}_amd64.deb && \
apt-get remove -y -q light-locker && \
rm ./turbovnc_${TURBOVNC_VERSION}_amd64.deb && \
ln -s /opt/TurboVNC/bin/* /usr/local/bin/

# apt-get may result in root-owned directories/files under $HOME
RUN chown -R $NB_UID:$NB_GID $HOME
RUN wget -q "https://sourceforge.net/projects/turbovnc/files/${TURBOVNC_VERSION}/turbovnc_${TURBOVNC_VERSION}_amd64.deb/download" -O turbovnc.deb \
&& apt-get install -y -q ./turbovnc.deb \
# remove light-locker to prevent screen lock
&& apt-get remove -y -q light-locker \
&& rm ./turbovnc.deb \
&& ln -s /opt/TurboVNC/bin/* /usr/local/bin/

ADD . /opt/install
COPY jupyter_desktop /opt/install/jupyter_desktop
COPY setup.py MANIFEST.in README.md LICENSE /opt/install/
RUN fix-permissions /opt/install

USER $NB_USER
RUN cd /opt/install && \
conda env update -n base --file environment.yml
RUN cd /opt/install \
&& mamba install -y websockify \
&& pip install -e .
8 changes: 0 additions & 8 deletions apt.txt

This file was deleted.

5 changes: 5 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Unfortunately the version of websockify on PyPI doesn't include the [compiled
# wrapper library](https://github.com/novnc/websockify#wrap-a-program) which is
# used by this extension, so either you'd have to manually compile it after pip
# installing websockify, or use the conda package.
#
channels:
- conda-forge
dependencies:
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
'desktop = jupyter_desktop:setup_desktop',
]
},
install_requires=['jupyter-server-proxy>=1.4.0'],
install_requires=[
'jupyter-server-proxy>=1.4.0',
],
include_package_data=True,
keywords=["Interactive", "Desktop", "Jupyter"],
license="BSD",
Expand Down

0 comments on commit 8f5b964

Please sign in to comment.