+ use ssh key from host machine in workspace container

This commit is contained in:
2025-06-11 20:47:53 +03:00
parent 94fe970cd3
commit 92cefd6fcd
3 changed files with 25 additions and 0 deletions

View File

@ -17,6 +17,7 @@ WORKSPACE_PGID=1000
WORKSPACE_INSTALL_YADM=true
WORKSPACE_INSTALL_FINE_UTILS=true
WORKSPACE_INSTALL_SSH=true
WORKSPACE_PHP_OPT_MEMORY_LIMIT=-1

View File

@ -41,6 +41,7 @@ services:
- CUSTOM_PGID=${WORKSPACE_PGID}
- INSTALL_YADM=${WORKSPACE_INSTALL_YADM}
- INSTALL_FINE_UTILS=${WORKSPACE_INSTALL_FINE_UTILS}
- INSTALL_SSH=${WORKSPACE_INSTALL_SSH}
- PHP_OPT_MEMORY_LIMIT=${WORKSPACE_PHP_OPT_MEMORY_LIMIT}
# Other args that might be used for customize in every separate container
# - CUSTOM_COMPOSER_VERSION=1

View File

@ -126,9 +126,32 @@ RUN if [ ${INSTALL_NODE} = true ]; then \
;fi
###########################################################################
# ssh:
###########################################################################
USER root
ARG INSTALL_SSH=false
ENV INSTALL_SSH ${INSTALL_SSH}
RUN if [ ${INSTALL_SSH} = true ]; then \
rm -f /etc/service/sshd/down \
;fi
USER laradock
RUN if [ ${INSTALL_SSH} = true ]; then \
mkdir -p ~/.ssh \
&& ln -s /run/secrets/user_ssh_key ~/.ssh/id_rsa \
&& ln -s /run/secrets/user_known_hosts ~/.ssh/known_hosts \
;fi
###########################################################################
# APT
###########################################################################
USER root
# once please
RUN apt update -qq