From fdec91b3be95070073098201324b80a53fe0abcc Mon Sep 17 00:00:00 2001 From: Oskars Germovs Date: Sat, 23 Mar 2024 02:36:55 +0200 Subject: [PATCH] @wip Signed-off-by: Oskars Germovs --- workspace/Dockerfile | 49 ++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 184e60e551..bbed25c32c 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -436,36 +436,31 @@ RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \ ARG INSTALL_WORKSPACE_SSH=false -RUN \ - mkdir -p /tmp/secure_ssh_keys && \ - chmod 7777 /tmp/secure_ssh_keys && \ - COPY secure_ssh_keys/id_rsa /tmp/secure_ssh_keys/id_rsa && \ - COPY secure_ssh_keys/id_rsa.pub /tmp/secure_ssh_keys/id_rsa.pub && \ - \ +RUN mkdir -p /tmp/secure_ssh_keys && \ mkdir -p /tmp/insecure_ssh_keys && \ - chmod 7777 /tmp/insecure_ssh_keys && \ - COPY insecure_id_rsa /tmp/insecure_ssh_keys/id_rsa && \ - COPY insecure_id_rsa.pub /tmp/insecure_ssh_keys/id_rsa.pub && \ - \ - COPY install_ssh_keys.sh /usr/local/bin/install_ssh_keys.sh && \ - chmod +x /usr/local/bin/install_ssh_keys.sh && \ - \ - /usr/local/bin/install_ssh_keys.sh && \ - \ + chmod 7777 /tmp/secure_ssh_keys && \ + chmod 7777 /tmp/insecure_ssh_keys \ + +COPY secure_ssh_keys/id_rsa secure_ssh_keys/id_rsa.pub /tmp/secure_ssh_keys/ +COPY insecure_id_rsa insecure_id_rsa.pub /tmp/insecure_ssh_keys/ +COPY install_ssh_keys.sh /usr/local/bin/install_ssh_keys.sh + +RUN chmod +x /usr/local/bin/install_ssh_keys.sh +RUN /usr/local/bin/install_ssh_keys.sh + +RUN if [ ${INSTALL_WORKSPACE_SSH} = true ]; then \ rm -rf /tmp/secure_ssh_keys && \ rm -rf /tmp/insecure_ssh_keys && \ - \ - if [ ${INSTALL_WORKSPACE_SSH} = true ]; then \ - rm -f /etc/service/sshd/down && \ - cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys && \ - cat /tmp/id_rsa.pub >> /root/.ssh/id_rsa.pub && \ - cat /tmp/id_rsa >> /root/.ssh/id_rsa && \ - rm -f /tmp/id_rsa* && \ - chmod 644 /root/.ssh/authorized_keys /root/.ssh/id_rsa.pub && \ - chmod 400 /root/.ssh/id_rsa && \ - cp -rf /root/.ssh /home/laradock && \ - chown -R laradock:laradock /home/laradock/.ssh \ - ;fi + rm -f /etc/service/sshd/down && \ + cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys \ + && cat /tmp/id_rsa.pub >> /root/.ssh/id_rsa.pub \ + && cat /tmp/id_rsa >> /root/.ssh/id_rsa \ + && rm -f /tmp/id_rsa* \ + && chmod 644 /root/.ssh/authorized_keys /root/.ssh/id_rsa.pub \ + && chmod 400 /root/.ssh/id_rsa \ + && cp -rf /root/.ssh /home/laradock \ + && chown -R laradock:laradock /home/laradock/.ssh \ +;fi ########################################################################### # MongoDB: