diff --git a/files/start-services-simplified.sh b/files/start-services-simplified.sh new file mode 100644 index 0000000..bee5e58 --- /dev/null +++ b/files/start-services-simplified.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +# Start sshd +/usr/sbin/sshd -D & \ No newline at end of file diff --git a/files/supervisord.conf b/files/supervisord.conf index f273a42..b596ca8 100644 --- a/files/supervisord.conf +++ b/files/supervisord.conf @@ -1,4 +1,5 @@ [supervisord] +user=%(ENV_NB_USER)s nodaemon=true logfile=/var/log/supervisor/supervisord.log pidfile=/tmp/supervisord.pid @@ -12,13 +13,14 @@ stderr_logfile=/var/log/supervisor/%(program_name)s.log autorestart=false [program:postgres] +user=%(ENV_NB_USER)s command=/usr/lib/postgresql/%(ENV_POSTGRES_VERSION)s/bin/postgres -c config_file=/etc/postgresql/%(ENV_POSTGRES_VERSION)s/main/postgresql.conf -user=postgres stdout_logfile=/var/log/supervisor/%(program_name)s.log stderr_logfile=/var/log/supervisor/%(program_name)s.log autorestart=true [program:sshd] +user=%(ENV_NB_USER)s command=/usr/sbin/sshd -D stdout_logfile=/var/log/supervisor/%(program_name)s.log stderr_logfile=/var/log/supervisor/%(program_name)s.log diff --git a/rsm-msba-arm/Dockerfile b/rsm-msba-arm/Dockerfile index f98b0be..57bbbab 100644 --- a/rsm-msba-arm/Dockerfile +++ b/rsm-msba-arm/Dockerfile @@ -346,6 +346,17 @@ RUN mkdir -p /var/run/sshd \ && chmod 0755 /var/run/sshd \ && chsh -s $(which zsh) ${NB_USER} +# fixing version issue +RUN apt-get update && \ + apt-get install -y openssl=3.0.2* && \ + apt-mark hold openssl && \ + apt-get install -y openssh-server && \ + rm -rf /var/lib/apt/lists/* + +# updating permissions +RUN chown -R ${NB_USER} /var/log/ \ + && chmod -R +x /var/log/ + # cleanup RUN rm -rf ~/work/ \ && rm -f ~/*.* diff --git a/rsm-simple-intel/Dockerfile b/rsm-simple-intel/Dockerfile new file mode 100644 index 0000000..d70b456 --- /dev/null +++ b/rsm-simple-intel/Dockerfile @@ -0,0 +1,35 @@ +# x86_64-ubuntu-22.04 7/25/2024 +FROM quay.io/jupyter/pyspark-notebook@sha256:fb5e83562d196ead71f31e4ae1e37c6fe13e1c13c3cbf55d64ffc6166f0aedb7 + +LABEL Vincent Nijs "radiant@rady.ucsd.edu" + +# Fix DL4006 +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +USER root + +# fixes the issue where sudo requires terminal for password when starting postgres +RUN echo "${NB_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + +COPY files/start-services-simplified.sh /usr/local/bin/start-services.sh +RUN chmod +x /usr/local/bin/start-services.sh + +# setting up ssh connection +RUN mkdir -p /var/run/sshd \ + && ssh-keygen -A \ + && echo 'PasswordAuthentication no' >> /etc/ssh/sshd_config \ + && echo 'PermitRootLogin no' >> /etc/ssh/sshd_config \ + && echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config \ + && echo "AllowUsers ${NB_USER}" >> /etc/ssh/sshd_config \ + && chmod 0755 /var/run/sshd \ + && chsh -s $(which zsh) ${NB_USER} + +EXPOSE 22 8989 + +# not running any commands yet +CMD ["/usr/local/bin/start-services.sh"] + +# Switch back to jovyan to avoid accidental container runs as root +USER ${NB_UID} +ENV HOME /home/${NB_USER} +WORKDIR "${HOME}"