Do not expose the port, comment the CMD directive.

This commit is contained in:
Andrea Dell'Amico 2023-03-16 16:05:17 +01:00
parent 2641e4a9f7
commit 445c6add40
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 20 additions and 11 deletions

View File

@ -27,6 +27,14 @@ ENV SHELL=/bin/bash \
LANGUAGE=en_US.UTF-8
ENV HOME="/home/${NB_USER}"
# Create NB_USER with name jovyan user with UID=1000 and in the 'users' group
# and make sure these dirs are writable by the `users` group.
RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \
sed -i.bak -e 's/^%admin/#%admin/' /etc/sudoers && \
sed -i.bak -e 's/^%sudo/#%sudo/' /etc/sudoers && \
chmod g+w /etc/passwd && \
fix-permissions "${HOME}"
RUN apt-get update --yes && \
apt-get upgrade --yes && \
apt-get install --yes --no-install-recommends \
@ -47,7 +55,13 @@ ADD 04_copy_env.sh /etc/cont-init.d/04_copy_env
ADD 05_setup_rsession_parameters.sh /etc/cont-init.d/05_setup_rsession_parameters
# Install the jupiterhub proxy
RUN pip3 install jupyter-rsession-proxy jupyterhub notebook
RUN pip3 install \
jupyterhub \
jupyterlab \
jupyter-rsession-proxy \
jupyter-server-proxy \
notebook
RUN apt-get clean && rm -rf /var/lib/apt/lists/* && \
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen
@ -60,14 +74,9 @@ RUN chmod a+rx /usr/local/bin/fix-permissions
# hadolint ignore=SC2016
RUN sed -i 's/^#force_color_prompt=yes/force_color_prompt=yes/' /etc/skel/.bashrc
# Create NB_USER with name jovyan user with UID=1000 and in the 'users' group
# and make sure these dirs are writable by the `users` group.
RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \
sed -i.bak -e 's/^%admin/#%admin/' /etc/sudoers && \
sed -i.bak -e 's/^%sudo/#%sudo/' /etc/sudoers && \
chmod g+w /etc/passwd && \
fix-permissions "${HOME}"
RUN NODE_OPTIONS="--openssl-legacy-provider" \
jupyter labextension install \
@jupyter-widgets/jupyterlab-manager jupyter-leaflet
# Prepare the workspace environment
# RUN mkdir -p /opt/workspace-lib
# RUN mkdir /var/log/workspace-lib
@ -75,6 +84,6 @@ RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \
# ADD 06_workspace_mount.sh /etc/cont-init.d/06_workspace_mount
# ADD 06-fuse-logback.xml /opt/workspace-lib/logback.xml
EXPOSE 8787
# EXPOSE 8787
CMD ["/init"]
# CMD ["/init"]