Created
August 27, 2014 13:52
-
-
Save TeMPOraL/3d134ce0d4a2b2f4232b to your computer and use it in GitHub Desktop.
Shell in Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; repl.sh | |
#!/bin/bash | |
if [[ "$#" -ne 1 ]]; then | |
echo "Usage: repl.sh 'script to be run'" | |
exit 1 | |
fi | |
screen -AdmS 'main' "$1" | |
screen -S 'main' -X screen bash -l | |
screen -r 'main' | |
;;; Dockerfile | |
;;; (...) | |
RUN apt-get install -y screen | |
RUN chmod u+s /usr/bin/screen ; chmod 755 /var/run/screen | |
ADD ./run.sh /var/run.sh | |
ADD ./repl.sh /var/repl.sh | |
CMD ["/var/repl.sh", "/var/run.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment