Persistence

This commit is contained in:
Christoffer Müller Madsen 2017-06-15 11:26:01 +02:00
parent 06eb99c84a
commit 0f936362d8
4 changed files with 20 additions and 5 deletions

View File

@ -9,14 +9,15 @@ RUN mkdir /var/run/sshd
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ADD eshell /usr/bin/
COPY tmp/eshell /usr/bin/
COPY Gemfile* /tmp/
COPY tmp/Gemfile* /tmp/
WORKDIR /tmp
RUN bundle install
ENV app /app
RUN mkdir $app
COPY tmp/run_server.sh /app/
WORKDIR $app
#ENV BUNDLE_PATH /box
@ -25,4 +26,4 @@ WORKDIR $app
VOLUME /home
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
ENTRYPOINT ["/app/run_server.sh"]

View File

@ -1,4 +1,8 @@
#!/bin/sh
cp ../eshell ./
cp ../Gemfile* ./
mkdir tmp
cp ../init_passwd.rb ./tmp/
cp ../run_server.sh ./tmp/
cp ../eshell ./tmp/
cp ../Gemfile* ./tmp/
docker build -t emacs-collab:latest .
rm -R tmp

6
init_passwd.rb Normal file
View File

@ -0,0 +1,6 @@
require_relative '/emacs-collab/lib/emacscollab/collab'
EmacsCollab.get_projects.each do |p|
`groupadd -g #{p.uid} #{p.posixname}`
`useradd -d /home/#{p.posixname} -g #{p.uid} -M -s /usr/bin/eshell -u #{p.uid} #{p.posixname}`
end

4
run_server.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
cd /emacs-collab
ruby init_passwd.rb
/usr/sbin/sshd -D