Browse Source

+ use ssh key from host machine in workspace container

master
Aleksandr Ivanov 2 weeks ago
parent
commit
92cefd6fcd
  1. 1
      .env.example
  2. 1
      docker-compose.base.yml
  3. 23
      dockerfiles/workspace/workspace.base.Dockerfile

1
.env.example

@ -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

1
docker-compose.base.yml

@ -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

23
dockerfiles/workspace/workspace.base.Dockerfile

@ -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

Loading…
Cancel
Save