Merge branch 'feature/KASM-1860_terminal_shell_exec' into 'develop'

KASM-1860 Add SHELL_EXEC environment variable for terminal image

Closes KASM-1860

See merge request kasm-technologies/internal/workspaces-images!8
This commit is contained in:
Justin Travis 2021-09-10 19:24:04 +00:00
commit 315d9a69eb
2 changed files with 9 additions and 1 deletions

View File

@ -13,6 +13,13 @@ RUN apt-get update && apt-get install -y tmux screen nano dnsutils zip
RUN echo "set -g mouse on" > $HOME/.tmux.conf && chown 1000:1000 $HOME/.tmux.conf
### Update .bashrc to run an arbitrary command if specified as an environment variable
RUN echo "if [ ! -z \"\${SHELL_EXEC}\" ] && [ \"\${TERM}\" == \"xterm-256color\" ] ; \n\
then \n\
set +e \n\
eval \${SHELL_EXEC} \n\
fi " >> $HOME/.bashrc && chown 1000:1000 $HOME/.bashrc
### Install Ansible
COPY ./src/ubuntu/install/ansible $INST_SCRIPTS/ansible/
RUN bash $INST_SCRIPTS/ansible/install_ansible.sh && rm -rf $INST_SCRIPTS/ansible/

View File

@ -8,4 +8,5 @@ This Image contains a browser-accessible version of [xfce4-terminal](https://doc
# Environment Variables
* `APP_ARGS` - Additional arguments to pass to the application when launched.
* `TERMINAL_ARGS` - Additional arguments to pass to the application when launched.
* `SHELL_EXEC`- A command to run when the terminal starts